I am breaking my head to configure a complex type in a WSDL file and see that complex type in SOAP UI client.
Find below the WSDL file.
<?xml version ='1.0' encoding ='UTF-8' ?>
<wsdl:definitions name='Catalog'
targetNamespace='http://website.net/websitesmsmobile'
xmlns:tns='http://website.net/websitesmsmobile'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<types>
<xsd:complexType name="xsd:parameter">
<xsd:sequence>
<xsd:element name="key" type="xsd:string"/>
<xsd:element name="value" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="xsd:parameters">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="parameter" type="tns:parameter"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</types>
<message name='callServerRequest'>
<part name='methodName' type='xsd:string'/>
<part name='parameter' type='paramters'/>
</message>
<message name='callServerResponse'>
<part name='response' type='xsd:string'/>
</message>
<portType name='websitePortType'>
<operation name='callServer'>
<input message='tns:callServerRequest'/>
<output message='tns:callServerResponse'/>
</operation>
</portType>
<binding name='websiteBinding' type='tns:websitePortType'>
<soap:binding
style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'
/>
<operation name='callServer'>
<soap:operation soapAction='urn:website-net-websitesmsmobile#callServer'/>
<input>
<soap:body
use='encoded'
namespace='urn:website-net-websitesmsmobile'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body
use='encoded'
namespace='urn:website-net-websitesmsmobile'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='websiteService'>
<port name='websitePort' binding='websiteBinding'>
<soap:address location='http://localhost/smsmobile/server/smsmobile.php'/>
</port>
</service>
</wsdl:definitions>
When I create a request in SOAP UI I see the below.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:website-net-websitesmsmobile">
<soapenv:Header/>
<soapenv:Body>
<urn:callServer soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<methodName xsi:type="xsd:string">?</methodName>
</urn:callServer>
</soapenv:Body>
</soapenv:Envelope>
The 'methodName' which is a string type got successfully generate. Why the complex type 'parameter' is not generated in the request?
Whats wrong in the WSDL file?
http://www.w3.org/TR/2001/NOTE-wsdl-20010315
(Example 5. SOAP binding of request-response RPC operation over HTTP)
GO through above link at example 5. Your schema definition is not correct at binding, thats why it is not showing your request message properly.
Related
I am trying to get my Flutter app to connect securely to soap/wsdl web services.
My question is how can I use servicestack product so I can connect my Flutter Mobile App or Dart console App to consume soap WSDL services?
Thanks
UPDATE:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://nick.mobile.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://nick.mobile.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://nick.mobile.com/">
<s:element name="C_getFilteredCustInfo_WithAssignNo">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AssignNo" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="clSecurityCheckBase" type="tns:cpSecurityCheckBase_WithAssignNo" />
<s:element minOccurs="0" maxOccurs="1" name="language" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="cpSecurityCheckBase_WithAssignNo">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AssignNo" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OrgData" />
<s:element minOccurs="0" maxOccurs="1" name="HashData" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="IP" type="s:string" />
</s:sequence>
</s:complexType>
...
...
...
ServiceStack's Dart and Flutter support relies on using the JsonWebClient with generated Typed DTOs, e.g:
import 'package:servicestack/client.dart';
import 'techstacks.dtos.dart';
var client = new JsonServiceClient("https://www.techstacks.io");
main() async {
var response = await client.get(new GetTechnology(slug: "flutter"));
print("${response.technology.name}: ${response.technology.vendorUrl}");
}
Which only works with ServiceStack's JSON endpoints, so you wouldn't be able to use it to call SOAP Services directly.
Instead as ServiceStack support SOAP Services as an additional endpoint for your ServiceStack Services you could have the same Service available from both JSON as well as SOAP 1.1/1.2 clients.
I'm kind of new with this Jmeter thing and I'm trying to do a simple SOAP/XML-RPC request on Jmeter. I'm using an example code I found on internet, that seems to work pretty fine (at least using Wizlet in Chrome didn't seem to have a problem), but when I use the soap request that generates the plug-in on the element in Jmeter... Well thats a different story. If someone could tell me the problem it would be awesome.
This is the code of the WSDL:
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://jee.javapapers.com" xmlns:intf="http://jee.javapapers.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://jee.javapapers.com">
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://jee.javapapers.com">
<element name="animalType">
<complexType>
<sequence>
<element name="animal" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="animalTypeResponse">
<complexType>
<sequence>
<element name="animalTypeReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="animalTypeResponse">
<wsdl:part element="impl:animalTypeResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="animalTypeRequest">
<wsdl:part element="impl:animalType" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AnimalTypeService">
<wsdl:operation name="animalType">
<wsdl:input message="impl:animalTypeRequest" name="animalTypeRequest"/>
<wsdl:output message="impl:animalTypeResponse" name="animalTypeResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AnimalTypeServiceSoapBinding" type="impl:AnimalTypeService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="animalType">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="animalTypeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="animalTypeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AnimalTypeServiceService">
<wsdl:port binding="impl:AnimalTypeServiceSoapBinding" name="AnimalTypeService">
<wsdlsoap:address location="http://localhost:8082/WebServicesAnimals/services/AnimalTypeService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And this is the request i'm sending and the response error.
URL: http://localhost:8082/WebServicesAnimals/services/AnimalTypeService?WSDL
BODY:
<?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>
<animalType xmlns="http://jee.javapapers.com">
<animal>Lion</animal>
</animalType>
</soapenv:Body>
</soapenv:Envelope>
Response:
<?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>
<soapenv:Fault>
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
<faultstring>no SOAPAction header!</faultstring>
<detail>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">WBFINF05</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
I see at least 2 problems:
Why are you sending your request to the URL ending with ?WSDL, you should use:
http://localhost:8082/WebServicesAnimals/services/AnimalTypeService
Error says you don't have a SOAPAction. If you confirm you didn't set it, add a Header Manager and set soapAction to ""
Finally you should use regular HTTP REquest instead of SOAP/XML-RPC Request as per this tutorial:
https://jmeter.apache.org/usermanual/build-ws-test-plan.html
I'm doing a project with WebSphere Message Broker which results in 2 BAR files. One the client and the other the server. Both are deployed in a broker in a remote location (a server upstairs). The WSDL that the server flow uses is inside an Message Set Project. Here is the wsdl structure:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3.1-hudson-749-SNAPSHOT. -->
<definitions targetNamespace="http://ws.interact.bytesw.com/" name="TvPagaInteractWebService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.interact.bytesw.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<types>
<xsd:schema>
<xsd:import namespace="http://ws.interact.bytesw.com/" schemaLocation="TvPagaInteractWebServiceService.xsd"/>
</xsd:schema>
</types>
<message name="ejecutarTransaccion">
<part name="parameters" element="tns:ejecutarTransaccion"/>
</message>
<message name="ejecutarTransaccionResponse">
<part name="parameters" element="tns:ejecutarTransaccionResponse"/>
</message>
<message name="consultarOperacion">
<part name="parameters" element="tns:consultarOperacion"/>
</message>
<message name="consultarOperacionResponse">
<part name="parameters" element="tns:consultarOperacionResponse"/>
</message>
<message name="consultarServicio">
<part name="parameters" element="tns:consultarServicio"/>
</message>
<message name="consultarServicioResponse">
<part name="parameters" element="tns:consultarServicioResponse"/>
</message>
<portType name="TvPagaInteractWebService">
<operation name="ejecutarTransaccion">
<input message="tns:ejecutarTransaccion"/>
<output message="tns:ejecutarTransaccionResponse"/>
</operation>
<operation name="consultarOperacion">
<input message="tns:consultarOperacion"/>
<output message="tns:consultarOperacionResponse"/>
</operation>
<operation name="consultarServicio">
<input message="tns:consultarServicio"/>
<output message="tns:consultarServicioResponse"/>
</operation>
</portType>
<binding name="TvPagaInteractWebServicePortBinding" type="tns:TvPagaInteractWebService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="ejecutarTransaccion">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="consultarOperacion">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="consultarServicio">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TvPagaInteractWebService">
<port name="TvPagaInteractWebServicePort" binding="tns:TvPagaInteractWebServicePortBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
</definitions>
Once deployed I want to use it from soapUI. But I don't know which endpoint configure it. I've been trying some combinations including the IP and port of the broker connection. But doesn't work, can someone help me, please?
At the bottom of your WSDL you have this
<service name="TvPagaInteractWebService">
<port name="TvPagaInteractWebServicePort" binding="tns:TvPagaInteractWebServicePortBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
In REPLACE_WITH_ACTUAL_URL goes the address where WMB should bind this particular service so its accesible from the outside
The port which the broker is listening on is a property of the listener. The SOAP nodes use the EG level embedded listener by default so you can find this by executing the command:
mqsireportproperties -e -o HTTPConnector -r
This port can be found in this information but also the current URL registrations are displayed.
The path that the service is bound to is defined by the URL property on the SOAP node itself which you can find from the toolkit.
I have to make a request to a web service, that uses Axis2, I'm too close to have it working but i keep getting error messages and i'm sure it is in the construction of my SOAP XML. This was the SOAP:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<RequestsoapHeader>
<spId>SPID</spId>
<spPassword>RandomPass</spPassword>
<timeStamp>20130115160251</timeStamp>
</RequestsoapHeader>
</soap:Header>
<soap:Body>
<operation>
<name>getSPToken</name>
<input>http://zzz.zzz.zzz.zzz/my/redirection/url/</input>
</operation>
</soap:Body>
</soap:Envelope>
UPDATE!!!! Now the soap is this:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<RequestsoapHeader>
<spId>SPID</spId>
<spPassword>RandomPass</spPassword>
<timeStamp>20130115160251</timeStamp>
</RequestsoapHeader>
</soap:Header>
<soap:Body>
<getSPTokenRequest>
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</getSPTokenRequest>
</soap:Body>
</soap:Envelope>
The part i can't fix is the Body, i tried to call the operation in different ways, for example instead of <operation> i used <operation name="getSPToken">, i also tried not using operation and created a tag with the name: <getSPToken>, but nothing works.
This is the WSDL part that describes the operation i'm trying to call in the Web Service:
<wsdl:operation name="getSPToken">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceException">
<soap:fault name="ServiceException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="PolicyException">
<soap:fault name="PolicyException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
UPDATE!!! This is the interface XML (part of the WSDL) that i didn't post before:
<wsdl:types>
<xsd:schema elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local">
<xsd:element name="getSPTokenRequest" type="osg_sicoweb_local_xsd:getSPTokenRequest"/>
<xsd:complexType name="getSPTokenRequest">
<xsd:sequence>
<xsd:element name="SPredirectURL"
type="xsd:string" maxOccurs="1" minOccurs="1">
<xsd:annotation>
<xsd:documentation></xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getSPTokenResponse" type="osg_sicoweb_local_xsd:getSPTokenResponse"/>
<xsd:complexType name="getSPTokenResponse">
<xsd:sequence>
<xsd:element name="SPToken" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
And this is the response i was getting:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Date: Tue, 15 Jan 2013 21:10:49 GMT
Connection: close
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault xmlns:axis2ns73="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>axis2ns73:Client</faultcode>
<faultstring>The endpoint reference (EPR) for the Operation not found is http://xxx.xxx.xxx.xxx:xxx/path/to/service/ and the WSA Action = </faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
UPDATE!!!! With the new changes, the response i'm getting is this one:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>org.apache.axis2.databinding.ADBException: Unexpected subelement getSPTokenRequest</faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
The operation getSPToken receives one parameter called SPredirectURL, that contains a URL of redirection, please help.
Try one of the following as your body:
<soap:Body>
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</soap:Body>
<soap:Body>
<getSPTokenRequest xmlns="http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local">
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</getSPTokenRequest>
</soap:Body>
Based on the WSDL snippet, the web service endpoint is using the document/literal convention for messages, but without the WSDL message declarations it is unclear whether the 'bare' (first example) or 'wrapped' (second example) version is expected. The post at this address (http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/) gives good insight into the various dialects described by WSDL.
UPDATE:
Based on the schema inside the wsdl:types section, the fully-qualified name for the element expected by the service (based on the declared targetNamespace attribute of the schema element) is http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local{getSPTokenRequest}
One way of establishing that name (inline namespace declaration) is shown in the updated second body above.
Post back with the next iteration.
i really need help with the simpliest things of WSDL.
i got the following WSDL, which is basically just generated code:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="MyFirstWSDL"
targetNamespace="http://www.example.org/MyFirstWSDL/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.example.org/MyFirstWSDL/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/MyFirstWSDL/">
<xsd:element name="getName">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getNameResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getNameRequest">
<wsdl:part name="parameters" element="tns:getName"></wsdl:part>
</wsdl:message>
<wsdl:message name="getNameResponse">
<wsdl:part name="parameters" element="tns:getNameResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="MyFirstInterface">
<wsdl:operation name="getName">
<wsdl:input message="tns:getNameRequest"></wsdl:input>
<wsdl:output message="tns:getNameResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NewBinding" type="tns:MyFirstInterface">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getName">
<soap:operation
soapAction="http://www.example.org/MyFirstWSDL/getName" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MyFirstService">
<wsdl:port name="MyFirstPort" binding="tns:NewBinding">
<soap:address location="http://localhost:8197/MyFirstService/" />
</wsdl:port>
</wsdl:service>
Now, when generating a provider and testing the service with the "Web Services Explorer" I keep getting the following exception:
IWAB0135E An unexpected error has occurred.
java.net.ConnectException
Connection refused: connect
So, do you have any clue or suggestions to solve this problem?
thx in advance, matt
Probably because http://localhost:8197/MyFirstService/ is not answering from where you call it.
You can try to check this by telnetting there or simply putting the Address in a browser window.
Though as it is localhost, you should know if you started the server, that is accepting the web service client or not.