need to construct a XML file and do HTTP POST to webservice URL--Blackberry - http

I need to construct a xml like this
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.xyz/2009/01.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.xyz.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<SOAP-ENV:Body><mns1:getVisitList xmlns:mns1="http://service.xyz.com/">
<input_no>321</input_no>
</mns1:getvisitlist>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
and i want to do http post this to a webservice url to get some json output response.. i dono where to start.. can anyone help me with this ?? any idea please..

Related

Host error during request eTicketCouponLLSRQ

Sometimes I receive ERR.SWS.HOST.CONNECTOR_ERROR while invoking eTicketCouponLLSRQ and sometimes I receive valid response. What is wrong?
Thank you!
I'm working in CERT, SRW version is 2.15.2 (SDK version), PCC Z4KB, EPR 1112
RQ:
<?xml version="1.0" encoding="UTF-8"?><eTicketCouponRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" TimeStamp="2018-04-23T10:36:18.907" Version="2.0.0">
<Ticketing eTicketNumber="5552484960880"/>
</eTicketCouponRQ>
RS:
<?xml version="1.0" encoding="UTF-8"?><eTicketCouponRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" TimeStamp="2018-04-23T10:36:18.907" Version="2.0.0">
<Ticketing eTicketNumber="XXXXXXXXX0880"/>
</eTicketCouponRQ><?xml version="1.0" encoding="UTF-8" standalone="no"?><eTicketCouponRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:stl="http://services.sabre.com/STL/v01" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.0.0">
<stl:ApplicationResults status="Unknown">
<stl:Error timeStamp="2018-04-23T01:33:59-05:00" type="Application">
<stl:SystemSpecificResults>
<stl:Message>Sending request to the Host failed</stl:Message>
<stl:ShortText>ERR.SWS.HOST.CONNECTOR_ERROR</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</eTicketCouponRS>
This is likely a timeout on a Sabre backend, meaning that it was not able to process it.
If you get many of this, I recommend you to contact the Sabre API helpdesk

How to post parameter with special symbol like "\/" or "|" in https://apigee.com GET api request?

We are trying to use an external SOAP service in our mobile app. We are converting that SOAP service into a GET method REST api using https://apigee.com. But that REST api , is changing our parameter value (which contain some special character like / | and all), when hitting actual SOAP api. How can we stop this encoding/decoding part in Apigee? is their any other free service available there for same purpose ?
REST API GET Request. So you will be sending request parameters in the URL as query parameters. Use the below flow
Use Extract Variables policy to extract query parameter variables
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="true" enabled="true" name="getqueryparams">
<DisplayName>getqueryparams</DisplayName>
<QueryParam name="param1">
<Pattern ignoreCase="true">{param1}</Pattern>
</QueryParam>
<QueryParam name="param2">
<Pattern ignoreCase="true">{param2}</Pattern>
</QueryParam>
<QueryParam name="param3">
<Pattern ignoreCase="true">{param3}</Pattern>
</QueryParam>
<Source>request</Source>
<VariablePrefix>getqueryparams</VariablePrefix>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</ExtractVariables>
Use Service callout policy to create and send SOAP POST Request
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-1">
<DisplayName>Custom label used in UI</DisplayName>
<Request clearPayload="true" variable="myRequest">
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<Set>
<Headers>
<Header name="Content-Type">text/xml</Header>
<Header name="SOAPAction">http://www.webserviceX.NET/GetWeather</Header>
</Headers>
<Payload contentType="text/xml">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetWeather xmlns="http://www.webserviceX.NET">
<CityName>{getqueryparams.param1}</CityName>
<CountryName>{getqueryparams.param2}</CountryName>
</GetWeather>
</soap:Body>
</soap:Envelope>
</Payload>
<Verb>POST</Verb>
</Set>
</Request>
<Response>response</Response>
<Timeout>60000</Timeout>
<HTTPTargetConnection>
<URL>http://www.webservicex.com/globalweather.asmx</URL>
</HTTPTargetConnection>
</ServiceCallout>
Use xml to json policy to convert the response xml to JSON in RESPONSE flow
Your service URL: http://superman-prod.apigee.net/service/getService?param1=abc/xyz&param2=one|two&param3=omgomgomg

Servlet mapping using annotation not working

I'm trying to do servlet mapping using annotation and it isn't working. In the past I've managed to get servlet mapping to work using some trial and error but I really don't want to do that, not anymore.
Here is the servlet placed.
|
|src
|abc.cde.fgh
|SearchDatabase.java
Here is the annotation I have added in SearchDatabase.java
#WebServlet("/pages/SearchDatabase")
I get the 404 (Not Found) when calling the servlet by GET on
http://localhost:8080/MyProject/pages/SearchDatabase?term=1
Here is the web.xml which I was not using initially because I didn't require that. I read that to use #WebServlet annotation, I need to have a web.xml.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>MyProject</display-name>
</web-app>
Please explain what is it that I am doing wrong.

BizTalk Orchestration with Envelope Schema

I have Flat File Schema in which I set the Allow Message Breakup at Infix Root to true. And also I set the Record Max Occurrence 1. To dispatch the message and send the multiple message to the send port.I used a Receive Pipeline(with flat file disassemble) and Send Pipeline (XML Transmit) in the receive and send ports. Till this it worked fine.
The input .txt File at the receive Port
1000 ABC IT
1001 DEF Maintenece
1002 GHI Payroll
The Output was three .xml files like
<?xml version="1.0" encoding="utf-8" ?>
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1000</ID>
<Name>ABC</Name>
<Dept>IT</Dept>
</Employee>
</Record>
<?xml version="1.0" encoding="utf-8" ?>
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1001</ID>
<Name>DEF</Name>
<Dept>Maintenece</Dept>
</Employee>
</Record>
<?xml version="1.0" encoding="utf-8" ?>
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1002</ID>
<Name>GHI</Name>
<Dept>Payroll</Dept>
</Employee>
</Record>
Now I wanted to send only the message with specific ID.So I added a Orchestration in to the Project where I am using decision shape, using the expression. Else I didn't want to send any message to the send Port.
Msg(FlatFilewithEnvelop.PropertySchema.ID) == 1000
If I send the same message in the Receive Port, I am getting four messages in the Send port(shown as below). I dont what was the mistake can anybody tell me what is the mistake.
<?xml version="1.0" encoding="utf-8" ?>
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1000</ID>
<Name>ABC</Name>
<Dept>IT</Dept>
</Employee>
</Record>
<?xml version="1.0" encoding="utf-8" ?>
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1000</ID>
<Name>ABC</Name>
<Dept>IT</Dept>
</Employee>
</Record>
<?xml version="1.0" encoding="utf-8" ?>
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1001</ID>
<Name>DEF</Name>
<Dept>Maintenece</Dept>
</Employee>
</Record>
<?xml version="1.0" encoding="utf-8" ?>
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1002</ID>
<Name>GHI</Name>
<Dept>Payroll</Dept>
</Employee>
</Record>
What is probably happening is that you initially created a send port with a filter subscribing to the messages.
Then you created an Orchestration that also subscribes to the messages and is bound to the send port.
If you look in BizTalk Server Administration Console and do a New Query and Search For Equals Subscriptions you will see a filter for your Send Port like below
Property Operator Value Group by
http://schemas.microsoft.com/BizTalk/2003/system-properties.SPTransportID == {GUID} Or
http://schemas.microsoft.com/BizTalk/2003/system-properties.MessageType == MesageType And
Notice how the subscription has an OR, the first will be the GUID for the port and the second part will be the filter you added to the port.
Any message published by an Orchestration that is bound to the port will set the SPTransportID to the GUID of the port.
The Filter on the send port is still looking for the messages and the Orchestration is also publishing a message to the port, hence the four messages.
The solution. Remove the Filter from the port.
Another thing is to keep your send port subscription and enrich it with the verification on the promoted field ID with desired value and disable the orchestration. So your message will be intercepted by the send port only.

Encryption Transformer in Mule

Please can anyone help me with encryption namespace and schema location in Mule 3.4.
I have this Configuration XML
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
<encryption:config name="Encryption_PGP" defaultEncrypter="PGP_ENCRYPTER" doc:name="Encryption_PGP">
<encryption:pgp-encrypter-config publicKeyRingFileName="./mule.gpg" secretKeyRingFileName="./secring.gpg" secretAliasId="3879972755627455806" secretPassphrase="mule1234" principal="test1"/>
</encryption:config>
<flow name="sdsd">
<encryption:encrypt config-ref="Encryption_PGP" doc:name="Encryption" using="PGP_ENCRYPTER" input-ref="#[message.payload]">
<encryption:pgp-encrypter principal="fernando.martinez <fernando.martinez#mulesoft.com>" />
</encryption:encrypt>
</flow>
</mule>
But its giving me this error: The prefix "encryption" for element "encryption:config" is not bound.
To use the the message processors from the encryption namespace you need to install the Anypoint Enterprise Security module
You can find more informations about how to use it here
That said this is an EE only feature, so if you don't have an EE license you should probably use the PGP security instead

Resources