can i specify 2 locations for a single portType operation in the service tag ? Basically this means that the client would call say url1 if it supports soap binding and url2 for some other bindings.
<wsdl:service name="NewService">
<wsdl:port name="NewPort" binding="tns:NewBinding">
<soap:address location="http://url1"/>
</wsdl:port>
<wsdl:port name="NewPort" binding="tns:NewBinding2">
<soap12:address location="http://url2"/>
</wsdl:port>
</wsdl:service>
can't i do something like this ? where you can access NewPort operation through either url1 or url2.
Yes, you can do something like this:
<wsdl:service name="NewService">
<wsdl:port name="NewPort" binding="tns:NewBinding">
<soap:address location="http://url1"/>
</wsdl:port>
<wsdl:port name="NewPort2" binding="tns:NewBinding2">
<soap12:address location="http://url2"/>
</wsdl:port>
</wsdl:service>
Both bindings can refer to the same portType.
Full WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://new.webservice.namespace" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://new.webservice.namespace">
<wsdl:types>
<xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="NewMessageRequest">
<wsdl:part name="parameter" type="xs:string"/>
</wsdl:message>
<wsdl:message name="NewMessageResponse">
<wsdl:part name="parameter" type="xs:string"/>
</wsdl:message>
<wsdl:portType name="NewPortType">
<wsdl:operation name="NewOperation">
<wsdl:input message="tns:NewMessageRequest"/>
<wsdl:output message="tns:NewMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NewBinding" type="tns:NewPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NewOperation">
<soap:operation soapAction="urn:#NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="NewBinding2" type="tns:NewPortType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NewOperation">
<soap12:operation soapAction="urn:#NewOperation" soapActionRequired="true" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NewService">
<wsdl:port name="NewPort" binding="tns:NewBinding">
<soap:address location="http://url1"/>
</wsdl:port>
<wsdl:port name="NewPort2" binding="tns:NewBinding2">
<soap12:address location="http://url2"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Related
I am invoking a business service from OSB 12C that accepts POST methods. I added a REST adapter in the business column after making the request and response XSD's. In the pipeline, I use an XQuery file for transformation of the proxy service's request body to the business service's body.
Examining the receiving app as well as the network traffic, I see that the request is being submitted with a Content-Type: application/x-www-form-urlencoded header, but the payload is completely blank.
As a test, I changed the method to GET. This places the form fields within the URL, so the transformation, etc. is correct. It just doesn't work in the POST method. I've been stuck for a week on this.
Here's the XSD for the business request:
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
targetNamespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
elementFormDefault="qualified" attributeFormDefault="unqualified" nxsd:encoding="US-ASCII">
<xsd:element name="GetPendingRequests-BusinessRequest-Root-Element">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="db" type="xsd:string"/>
<xsd:element name="fromDate" type="xsd:string"/>
<xsd:element name="max" type="xsd:integer"/>
<xsd:element name="page" type="xsd:integer"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:annotation>
<xsd:appinfo>NXSDSAMPLE=</xsd:appinfo>
<xsd:appinfo>USEHEADER=false</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
And the XQuery file:
xquery version "1.0" encoding "utf-8";
(:: OracleAnnotationVersion "1.0" ::)
declare namespace smar="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request";
(:: import schema at "GetPendingRequestsBusinessRequest.xsd" ::)
declare variable $db as xs:string external;
declare variable $fromDate as xs:string external;
declare variable $max as xs:integer external;
declare variable $page as xs:integer external;
declare function local:func($db as xs:string, $fromDate as xs:string, $max as xs:integer, $page as xs:integer) as element()
(:: schema-element(smar:GetPendingRequests-BusinessRequest-Root-Element) ::) {
<smar:GetPendingRequests-BusinessRequest-Root-Element
xmlns:smar="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request">
<smar:db>{fn:data($db)}</smar:db>
<smar:fromDate>{fn:data($fromDate)}</smar:fromDate>
<smar:max>{fn:data($max)}</smar:max>
<smar:page>{fn:data($page)}</smar:page>
</smar:GetPendingRequests-BusinessRequest-Root-Element>
};
local:func($db, $fromDate, $max, $page)
The WADL file:
<?xml version = '1.0' encoding = 'UTF-8'?>
<application xmlns:soa="http://www.oracle.com/soa/rest"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
xmlns="http://wadl.dev.java.net/2009/02">
<doc title="SmartCardBusinessServices">WADL Reference for REST calls for smart cards</doc>
<grammars>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessRequest.xsd"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessResponse.xsd"/>
</xsd:schema>
</grammars>
<resources>
<resource path="/getPendingRequests">
<method name="POST" soa:wsdlOperation="GetPendingRequests">
<request>
<representation mediaType="application/x-www-form-urlencoded"
element="cns:GetPendingRequests-BusinessRequest-Root-Element"
xmlns:cns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"/>
</request>
<response status="200">
<representation mediaType="application/json"
element="cns:GetPendingRequests-BusinessResponse-Root-Element"
xmlns:cns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"/>
</response>
</method>
</resource>
</resources>
</application>
Lastly, the WSDL:
<?xml version= '1.0' encoding= 'UTF-8' ?>
<wsdl:definitions
name="SmartCardBusinessServices"
targetNamespace="http://xmlns.oracle.com/ServiceBusApplication1/MVRServices/SmartCardBusinessServices"
xmlns:tns="http://xmlns.oracle.com/ServiceBusApplication1/MVRServices/SmartCardBusinessServices"
xmlns:inp1="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
xmlns:inp2="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<plnk:partnerLinkType name="SmartCardBusinessServices">
<plnk:role name="SmartCardBusinessServicesProvider" portType="tns:SmartCardBusinessServices_ptt"/>
</plnk:partnerLinkType>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessRequest.xsd"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessResponse.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetPendingRequests_inputMessage">
<wsdl:part name="request" element="inp1:GetPendingRequests-BusinessRequest-Root-Element"/>
</wsdl:message>
<wsdl:message name="GetPendingRequests_outputMessage">
<wsdl:part name="reply" element="inp2:GetPendingRequests-BusinessResponse-Root-Element"/>
</wsdl:message>
<wsdl:portType name="SmartCardBusinessServices_ptt">
<wsdl:operation name="GetPendingRequests">
<wsdl:input message="tns:GetPendingRequests_inputMessage"/>
<wsdl:output message="tns:GetPendingRequests_outputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SmartCardBusinessServices_ptt-binding" type="tns:SmartCardBusinessServices_ptt">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetPendingRequests">
<soap:operation soapAction="GetPendingRequests"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
I'm getting this message when attempting to create a new SoapUI project and import a WSDL for Web Service Simulation. The error message seems incomplete as it does not actually say what tag is not being closed.
Error loading [file:\C:\chad.wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: does not close tag
Here's the WSDL:
<wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="SayHiRequest">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="SayHiResponse">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Hello_PortType">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:SayHiRequest"/>
<wsdl:output message="tns:SayHiResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="sayHi"/>
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Hello_Service">
<wsdl:documentation>WSDL File for HelloService</documentation>
<wsdl:port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address location="http://www.examples.com/chad/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
My WSDL seems to validate.
I've found some similar issues online where the wsdl is imported from an http url and the import results in this same error, but i'm importing straight from my C drive (not over http) so the suggested solutions have not worked.
There was a namespace issue in the following line
Original line
<wsdl:documentation>WSDL File for HelloService</documentation>
Changed to
<wsdl:documentation>WSDL File for HelloService</wsdl:documentation>
Here is the updated wsdl
<?xml version='1.0' encoding="UTF-8"?>
<wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="SayHiRequest">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="SayHiResponse">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Hello_PortType">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:SayHiRequest"/>
<wsdl:output message="tns:SayHiResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="sayHi"/>
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Hello_Service">
<wsdl:documentation>WSDL File for HelloService</wsdl:documentation>
<wsdl:port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address location="http://www.examples.com/chad/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I was able to load the WSDL in soapUI 4.5.2 without getting the error you got. Although, I did get the below error.
Tue Aug 20 11:30:21 ADT 2013:ERROR:Could not find element [{https://something.com/service/types}IsAvailableRequest] specified in part [parameters]
I had the same error but a different cause:
Instead of:
https://sitename.com/prefix/app/services.asxm
Use:
https://sitename.com/prefix/app/services.asxm?WSDL
I hadn't used SOAP before and it wasn't immediately obvious that I was missing the ?WSDL from the url. Posting just in case anyone else has the same issue.
I use Log4Net for logging. When the application starts, I call
log4net.Config.XmlConfigurator.Configure();
But this line takes 15 seconds to finish. Am I doing something wrong? Or is it normal?
I am developing with ASP.NET MVC, an use Unity for dependency injection.
At the application start, I call a Bootstrapper Initialise function
protected void Application_Start()
{
IUnityContainer container = Bootstrapper.Initialise();
...
...
}
In the Bootstrapper Initialize function, I register the type ILog.
private static IUnityContainer BuildUnityContainer()
{
var container = new UnityContainer();
...
...
container.RegisterType<ILog>("", new ContainerControlledLifetimeManager(),
new InjectionFactory(factory =>
LogManager.GetLogger(typeof(HomeController).Assembly, connectionString)));
...
...
}
At the beginning of GetLogger function I call the configure function
public static ILog GetLogger(Assembly assembly, string connectionString)
{
log4net.Config.XmlConfigurator.Configure(); //<----- it takes 15 seconds to finish
...
...
}
EDIT
---------------------------------------------------------------------------------
<log4net>
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="0" />
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="data source=[database server];initial catalog=[database name];integrated security=false;persist security info=True;User ID=[user];Password=[password]" />
<commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception],[UserId],[Operation],[EntityType],[EntityId],[IP],[Host],[SessionId],[LogGroup]) VALUES (#log_date, #thread, #log_level, #logger, #message, #exception, #UserId, #Operation, #EntityType, #EntityId, #IP, #Host, #SessionId, #LogGroup)" />
<parameter>
<parameterName value="#log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawTimeStampLayout" />
</parameter>
<parameter>
<parameterName value="#thread" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%thread" />
</layout>
</parameter>
<parameter>
<parameterName value="#log_level" />
<dbType value="String" />
<size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level" />
</layout>
</parameter>
<parameter>
<parameterName value="#logger" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%logger" />
</layout>
</parameter>
<parameter>
<parameterName value="#message" />
<dbType value="String" />
<size value="4000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message" />
</layout>
</parameter>
<parameter>
<parameterName value="#exception" />
<dbType value="String" />
<size value="2000" />
<layout type="log4net.Layout.ExceptionLayout" />
</parameter>
<parameter>
<parameterName value="#UserId"/>
<dbType value="Int32" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="UserId" />
</layout>
</parameter>
<parameter>
<parameterName value="#IP"/>
<dbType value="String" />
<size value="25" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="IP" />
</layout>
</parameter>
<parameter>
<parameterName value="#Host"/>
<dbType value="String" />
<size value="50" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="Host" />
</layout>
</parameter>
<parameter>
<parameterName value="#LogGroup"/>
<dbType value="Int32" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="LogGroup" />
</layout>
</parameter>
<parameter>
<parameterName value="#Operation"/>
<dbType value="Int32" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="Operation" />
</layout>
</parameter>
<parameter>
<parameterName value="#EntityType"/>
<dbType value="Int32" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="EntityType" />
</layout>
</parameter>
<parameter>
<parameterName value="#EntityId"/>
<dbType value="Int32" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="EntityId" />
</layout>
</parameter>
<parameter>
<parameterName value="#SessionId"/>
<dbType value="String" />
<size value="88" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="SessionId" />
</layout>
</parameter>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="AdoNetAppender" />
</root>
</log4net>
15 Seconds sounds like a (connection) timeout, I believe the default timeout is 15 seconds.
I had a similar problem once and it turned out to be The CLR tried to verify the authenticode signature at load time to create publisher evidence for an assembly.
I am not sure about the details but there is a configuration element named "generatePublisherEvidence" in the assembly section where it can be turned off. You should check if you want to do this though. And what the implications for this are.
If you are using .Net 4 (or greater) this should have no impact on load time.
For web applications this setting cannot be set in the applications web.config. It should be set in the aspnet.config in the .Net framework directory.
When you try to call the following statement
log4net.Config.XmlConfigurator.Configure();
The system will try to validate the given database connection string. Here the problem is, your given connection string might be not connecting and it is trying to connect until it's given a time out.
Please verify is your given connection string is valid or not.
http://techxposer.com/2017/08/08/log4net-config-xmlconfigurator-configure-taking-too-much-time/
I was wondering if is there some way to convert an old RPC WSDL file to a JAX-WS WSDL file. Tried my best to make sure I did my homework but I'm kind of lost here.
From what I've read, I should remove all the 'encodingstyle' ocurrences and switch use="encoded" to use="literal". I can't run any tests by now since the service is currently unavailable. Does anyone know if that should be enough? Any insight will be extremely appreciated.
This is my WSDL file:
<?xml version="1.0" encoding="iso-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:wsScrc.XML" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:wsScrc.XML">
<types>
<xsd:schema targetNamespace="urn:wsScrc.XML">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
</xsd:schema>
</types>
<message name="XMLRequest">
<part name="parmA" type="xsd:string" />
<part name="parmB" type="xsd:string" />
<part name="parmC" type="xsd:string" />
<part name="parmD" type="xsd:string" />
<part name="parmE" type="xsd:string" />
<part name="parmF" type="xsd:string" />
<part name="parmG" type="xsd:string" />
</message>
<message name="XMLResponse">
<part name="respA" type="xsd:string" />
<part name="respB" type="xsd:string" />
<part name="respC" type="xsd:string" />
<part name="respD" type="xsd:string" />
<part name="respE" type="xsd:string" />
</message>
<message name="monitorRequest"></message>
<message name="monitorResponse">
<part name="ipServidor" type="xsd:string" />
</message>
<portType name="wsScrc.XMLPortType">
<operation name="XML">
<documentation>Retorna o xml</documentation>
<input message="tns:XMLRequest"/>
<output message="tns:XMLResponse"/>
</operation>
<operation name="monitor">
<documentation>Retorna uma mensagem de ok</documentation>
<input message="tns:monitorRequest"/>
<output message="tns:monitorResponse"/>
</operation>
</portType>
<binding name="wsScrc.XMLBinding" type="tns:wsScrc.XMLPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="XML">
<soap:operation soapAction="urn:wsScrc.XML#XML" style="rpc"/>
<input>
<soap:body use="encoded" namespace="urn:wsScrc.XML" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:wsScrc.XML" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="monitor">
<soap:operation soapAction="urn:wsScrc.monitor#monitor" style="rpc"/>
<input>
<soap:body use="encoded" namespace="urn:wsScrc.monitor" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:wsScrc.monitor" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="wsScrc.XML">
<port name="wsScrc.XMLPort" binding="tns:wsScrc.XMLBinding">
<soap:address location="http://thisismyaddress/webservicePHP/ws.php"/>
</port>
</service>
</definitions>
Thanks in advance.
We were able to do the same by altering the WSDL in that way.
The only issue is that we had to use SAAJ in order to generate the right request and to process the response.
In another WS we used it was just not possible because the XML in the body is generated by Castor. Finally we did not succeed as we did not know what the server expect.
In conclusion I would say: it depends how the server was implemented.
I'm using this wsdl-file to describe my webservice:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://www.myapproach.de/knowledgebase" name="Knowledgebase"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://www.myapproach.de/knowledgebase"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:rq="http://www.myapproach.de/knowledgebase">
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://www.myapproach.de/knowledgebase" schemaLocation="GetValueRequest.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getValueForKey">
<wsdl:part name="parameters" element="rq:getValueForKey" />
</wsdl:message>
<wsdl:message name="getValueForKeyResponse">
<wsdl:part name="parameters" element="rq:getValueForKeyResponse" />
</wsdl:message>
<wsdl:portType name="KnowledgebasePortType">
<wsdl:operation name="getValueForKey">
<wsdl:input message="tns:getValueForKey" />
<wsdl:output message="tns:getValueForKeyResponse" />
</wsdl:operation>
</wsdl:portType>
<wsp:Policy wsu:Id="KnowledgebasePortBinding_WSAM_Addressing_Policy">
<wsam:Addressing wsp:Optional="true">
<wsp:Policy />
</wsam:Addressing>
</wsp:Policy>
<wsdl:binding name="KnowledgebasePortBinding" type="tns:KnowledgebasePortType">
<wsaw:UsingAddressing />
<wsp:PolicyReference URI="#KnowledgebasePortBinding_WSAM_Addressing_Policy" />
<!-- http://www.w3.org/2003/05/soap/bindings/HTTP/ -->
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<wsdl:operation name="getValueForKey">
<soap:operation soapAction="http://www.myapproach.de/knowledgebase/getValueForKey" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Knowledgebase">
<wsdl:port name="KnowledgebasePortType" binding="tns:KnowledgebasePortBinding">
<soap:address location="http://www.myapproach.de/knowledgebase" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
GetValueRequest.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.myapproach.de/knowledgebase" xmlns:tns="http://www.myapproach.de/knowledgebase">
<xsd:element name="getValueForKey" type="tns:getValueForKey" />
<xsd:complexType name="getValueForKey">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:string" minOccurs="0" />
<xsd:element name="arg1" type="xsd:string" minOccurs="0" />
<xsd:element name="arg2" type="xsd:double"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getValueForKeyResponse" type="tns:getValueForKeyResponse" />
<xsd:complexType name="getValueForKeyResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Everytime I run wsimport, I get this error:
[wsimport] parsing WSDL...
[wsimport] [ERROR] Invalid wsdl:operation "getValueForKey": its a rpc-literal operation, message part must refer to a schema type declaration
[wsimport] line 27 of file:/path/MyFile.wsdl
I have exported the getValueForKey type to the xsd-schemafile, so I don't understand this error... I'm trying this sh*** the whole day grml
Shortly after posting the question I found the answer :-)
Instead of
<wsdl:message name="getValueForKey">
<wsdl:part name="parameters" element="rq:getValueForKey" />
</wsdl:message>
use this
<wsdl:message name="getValueForKey">
<wsdl:part name="parameters" type="rq:getValueForKey" />
</wsdl:message>
the attribute "type" must be used instead of "element".
Additionally the soap:body element has to have a namespace
<wsdl:input>
<soap:body use="literal" namespace="YourNormalNamespace" />
</wsdl:input>
In short, wsdl part has to have type in case of RPC style of webservices else it has to be document style.