Sending a SOAP request using Postman - post

I'm trying to send a SOAP request to the Loqate services following their API documentation found here.
The documentation says the SOAP end point is
https://api.addressy.com/Capture/Interactive/Find/v1.1/wsdlnew.ws
and the sample request is:
<?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>
<Find
xmlns="http://api.addressy.com/">
<Key>AA11-AA11-AA11-AA11</Key>
<Text>wr5 3da</Text>
<IsMiddleware>True</IsMiddleware>
<Container>GB|RM|ENG|3DA-WR5</Container>
<Origin>52.182,-2.222</Origin>
<Countries>GB,US,CA</Countries>
<Limit>10</Limit>
<Language />
<Bias />
<Filters />
<GeoFence />
</Find>
</soap:Body>
</soap:Envelope>
So I load up Postman and make these steps, following the Postman guide from their blog.
When I send the request, I just get back this page . I'm not sure why it's not working.
How can I make a SOAP request to this API? What am I missing?

That's not the service endpoint, it's an address where you can get the WSDL. Inside that WSDL you will find the service endpoint:
<soap:address location="http://services.postcodeanywhere.co.uk/Capture/Interactive/Find/v1.10/soapnew.ws"/>
Send your request there. The endpoint is over http, but the https seems to be working on the same address: https://services.postcodeanywhere.co.uk/Capture/Interactive/Find/v1.10/soapnew.ws
One other thing. If you want a more specific client than Postman, you could try SoapUI.

Related

Error while sending POST request to WSO2 ESB

I've created a proxy to tweet using WSO2 ESB Twitter connector. My Tweet proxy looks like this.
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="Tweet" startOnLoad="true" trace="disable"
transports="http https" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<property expression="json-eval($.message)" name="Tweet"
scope="default" type="STRING"/>
<twitter.init>
<consumerKey>xxxxxxxxxx</consumerKey>
<consumerSecret>xxxxxxxxxxxx</consumerSecret>
<accessToken>xxxxxxxxxxxxx</accessToken>
<accessTokenSecret>xxxxxxxxxx</accessTokenSecret>
</twitter.init>
<twitter.updateStatus>
<status>{$ctx:Tweet}</status>
</twitter.updateStatus>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
</proxy>
The project was deployed without any errors but when ever i make a POST request to Tweet from Postman im getting an error status of 170 with a message Missing required parameter: status.
The Post request consist of a json like this.
{"Content-Type":"application/json","payload":"{\"message\":\"Hellow WSO2 ESB!!!! #WSO2 #Test\"}"}
In the ESB sever console it gives an error like this
ERROR - SynapseJsonPath #stringValueOf. Error evaluating JSON Path <$.message>. Returning empty result. Error>>> invalid path
Any particular reason why im getting this error?. How to overcome this?.
Change the property expression like this.
expression="json-eval($.payload.message)"

requested data getting null in soap web service from ios

I am trying to insert data into the SQL server database through SOAP XML Web service from IOS using Swift code, but it is get only Id value which is auto generate in database ,but i cant insert my data into table because it will get null values which i have passed in Soap message.
My Code in swift
<?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>
<CreateUserDetail xmlns='http://tempuri.org/'>
<userdetail>
<UserDetail>
<Id>1</Id>
<Username xsi:type='xs:string'>username</Username>
<Password xsi:type='xs:string'>password</Password>
</UserDetail>
</userdetail>
</CreateUserDetail>
</soap:Body>
</soap:Envelope>
I have surfing many of blog and sites and finally I got solution for it here is a soap message with solution
my new soap message is written below
<SOAP-ENV:Envelope xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:tns='http://tempuri.org/' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<tns:CreateUserDetail>
<tns:userdetail>
<tns:Id xmlns:tns='http://schemas.datacontract.org/2004/07/WcfService1'>1</tns:Id>
<tns:Username xmlns:tns='http://schemas.datacontract.org/2004/07/WcfService1'>String</tns:Username>
<tns:Password xmlns:tns='http://schemas.datacontract.org/2004/07/WcfService1'>String</tns:Password>
</tns:userdetail>
</tns:CreateUserDetail>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
you have to just replace xmlns:tns='your target namespace' which i have write in id,username,password element
hope it will help someone

Using Servicestack WSDL with php

I am trying to use ServiceStack to replace WCF for a self hosted service, accessed with a PHP client that forms its messages from on the WSDL.
The WSDL produced by ServiceStack has "part names" called "par" eg:
<wsdl:message name="GetServiceDetailsIn">
<wsdl:part name="par" element="tns:GetServiceDetails" />
</wsdl:message>
Then the SOAP request produced by PHP looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body><par/></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
instead of this from the built-in help:
<?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>
<GetServiceDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:Shout" />
</soap:Body>
</soap:Envelope>
The PHP client has used a par tag instead of GetServiceDetails and it gets a blank response. Can the "part name" definition can be renamed or removed in ServiceStack?
It seems you can't doing anything about this in ServiceStack and its not designed to work with PHP anyway. However you can get it working if you get PHP to tweak the XML tags with find-and-replace, or XSLTs, before sending it.

QuickBooks (QBD) SyncActivity inconsistent behavior?

I am using QuickBooks (QBD) SyncActivity API to get the information about Quickbooks Desktop synchronizations.But sometime when I call SyncActivity API I didn't get response and sometimes I get response.
Is there any connectivity issue with cloud or Is there anyting I'm missing to specify to get details from cloud, below is Request and code for more details,
//Sync Activity details
Intuit.Ipp.Data.Qbd.SyncActivityRequest syncActivityRequest = new SyncActivityRequest();
var syncStatuses = dataServices.GetSyncActivity(syncActivityRequest);
syncActivity Request,
<?xml version="1.0" encoding="utf-8"?>
<SyncActivityRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intuit.com/sb/cdm/v2" />
Please share your views and suggessions.
Thanks,
Reshma D.
You pass in a begin and end time stamp and you will get a response if there was any sync activity within the time span that you specified. There may or may not be something to return
<?xml version="1.0"?>
<SyncActivityRequest xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.intuit.com/sb/cdm/v2 RestDataFilter.xsd ">
<OfferingId>ipp</OfferingId>
<StartCreatedTMS>2011-06-02T08:31:25.0Z</StartCreatedTMS>
<EndCreatedTMS>2011-06-02T08:31:28.0Z</EndCreatedTMS>
</SyncActivityRequest>
Thanks
Jarred

cxf - parsing soap messages element's attribute

I'm getting a soap request like this:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<notifications xmlns="xxxxx">
<sometags></sometags>
<Notification>
<Id>yyyyy</Id>
<sObject xsi:type="sf:Dog" xmlns:sf="urn:some.enterprise.object.soap.com">
<sf:Id>zzzzz</sf:Id>
</sObject>
</Notification>
</notifications>
</soapenv:Body>
</soapenv:Envelope>
and I want to find out what kind of object is the notification about (== I want to read the sObject's type attribute, so
that I know whos type of sObject is related the id tag).
I want to be able to do something similar:
if (sObject.type.equals("Dog"))
//do something
if (sObject.type.equals("Cat"))
//do something else
but how can i get that attribute value in the soap request?
I'm using java with cxf libraries .
Thank you,
Cloutz
Just use Interceptor & do what ever you want.

Resources