I am fighting the last two days with the same problem and I don't know how to fix this. Even not sure if it is an error or not.
I have a CXF Web Service with something I consider very strange and I would like to fix. This is one of the calls that the Web Service deals with:
#WebResult (name="merchantHierarchyParentResponse") MerchantHierarchyParentResponseDTO
getParent(
#WebParam(name="institutionNumber") #XmlElement(required=true) String institutionNumber,
#WebParam(name="clientNumber") String clientNumber,
#WebParam(name="ourReference") String ourReference,
#WebParam(name="accessMerch") String accessMerch,
#WebParam(header=true, name="callerId") String callerId,
#WebParam(header=true, name="timestamp") String timestamp,
#WebParam(header=true, name="signature") String signature
);
As you can see, it receives 4 normal parameters plus 3 extra parameters in the header (callerId, timestamp and signature).
It compiles successfully. Then I deploy it also successfully in a WebLogic server.
Finally, I use SoapUI to test it. I provide SoapUI with the URL that WebLogic is providing me with the WSDL. This is, I am not doing any change in the automatic generated WSDL. This is what I am getting for this getParent in SoupUI:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webService.webservice.omnipay.com.server/">
<soapenv:Header>
<web:signature>?</web:signature>
<web:timestamp>?</web:timestamp>
<web:callerId>?</web:callerId>
</soapenv:Header>
<soapenv:Body>
<web:getParent>
<institutionNumber>?</institutionNumber>
<!--Optional:-->
<clientNumber>?</clientNumber>
<!--Optional:-->
<ourReference>?</ourReference>
<!--Optional:-->
<accessMerch>?</accessMerch>
</web:getParent>
<web:callerId>?</web:callerId>
<web:timestamp>?</web:timestamp>
<web:signature>?</web:signature>
</soapenv:Body>
</soapenv:Envelope>
My question is very clear. I see the 3 parameters in the header section (callerId, timestamp and signature) but why these 3 parameters are AGAIN at the end in the body part. I don't want them in the body part, I want them only in the header.
Any idea why this is happening? Is it a bug?
Hi and thanks to the people that helped me to fix the problem.
Here the portion of the wsdl:binding related with the getParent call:
<wsdl:binding name="ServiceImplServiceSoapBinding" type="tns:IService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getParent">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getParent">
<soap:header encodingStyle="" message="tns:getParent" part="callerId" use="literal"/>
<soap:header encodingStyle="" message="tns:getParent" part="timestamp" use="literal"/>
<soap:header encodingStyle="" message="tns:getParent" part="signature" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getParentResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
I had to change in the section , this line
<soap:body use="literal"/>
for this one
<soap:body use="literal" parts="parameters"/>
Not very sure why this parts attribute was not generated in my automatically generated WSDL, but well, it fixed my problem. I don´t like to make this manual change in the wsdl. Anyway, at least my problem is fixed.
Related
I've been try to figure out a way to get a URL pointing to a candidate's profile in Workday given a candidate's WID. My scenario is that I use the Put_Candidate operation (Workday Web Services SOAP API) to create a candidate which lets me know the WID and the Candidate_ID of the created candidate. From this returned information, I was hoping to construct the URL to the created candidate's profile in Workday. Is this possible? I'd appreciate any help/guidance that anyone can provide regarding this sort of scenario. Thank you.
I know its a little late, but if you are still looking for an answer then you can use
Get_workers api in Humar Resource Module and frame a request as below:-
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>your username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">your password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<wd:Get_Workers_Request xmlns:wd="urn:com.workday/bsvc" version="set appropriate version here">
<wd:Request_References bsvc:Skip_Non_Existing_Instances="false">
<wd:Worker_Reference >
<wd:ID wd:type="WID">Populate WID here</wd:ID>
</wd:Worker_Reference>
</wd:Request_References>
</wd:Get_Workers_Request>
</soapenv:Body>
</soapenv:Envelope>
While i am sending Add Itinerary Remark in sabre FLIGHT API Request it's through Error (Business logic Error). Please Suggest me
<?xml version='1.0' encoding='utf-8'?>
<soap-env:Envelope xmlns:soap-env='http://schemas.xmlsoap.org/soap/envelope/'>
<soap-env:Header>
<eb:MessageHeader xmlns:eb='http://www.ebxml.org/namespaces/messageHeader'>
<eb:From>
<eb:PartyId eb:type='urn:x12.org.IO5:01'>sabre#example.com</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type='urn:x12.org.IO5:01'>webservices.sabre.com</eb:PartyId>
</eb:To>
<eb:ConversationId>1500986572sabre#example.com</eb:ConversationId>
<eb:Service eb:type='OTA'>Air</eb:Service>
<eb:Action>AddRemarkLLSRQ</eb:Action>
<eb:CPAID>IPCC</eb:CPAID>
<eb:MessageData>
<eb:MessageId>mid:1500986572sabre#example.com</eb:MessageId>
<eb:Timestamp>2017-07-25T12-42-52Z</eb:Timestamp>
<eb:TimeToLive>2017-07-25T12-42-52Z</eb:TimeToLive>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/12/secext'>
<wsse:UsernameToken>
<wsse:Username>USER</wsse:Username>
<wsse:Password>PASS</wsse:Password>
<Organization>IPCC</Organization>
<Domain>Default</Domain>
</wsse:UsernameToken>
<wsse:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!-3250684970584119419!1379810!0</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<AddRemarkRQ xmlns='http://webservices.sabre.com/sabreXML/2011/10' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ReturnHostCommand='false' Version='2.1.0'>
<RemarkInfo>
<FOP_Remark>
<CC_Info>
<PaymentCard Code="VI" ExpireDate="2022-3" Number="4111111111111111" />
</CC_Info>
</FOP_Remark>
<Remark Type="General">
<Text>Swadesh Dash,nandan#gmail.com,8989852356</Text>
</Remark>
<Remark Type="Client Address">
<Text>Swadesh Dash,8989852356, nandan#gmail.com</Text>
</Remark>
</RemarkInfo>
</AddRemarkRQ>
</soap-env:Body>
</soap-env:Envelope>
Would help knowing what is the business error you got, but I see:
ExpireDate="2022-3" - I presume that it does not take 3 as month, it should be 03
In the other 2 remarks there # signs which likely are characters not supported in remarks.
For an improved response, please post the business error.
I can get only one possible reason and that is "Special Characters not allowed by Sabre"
And you have used # in remarks.
Special Characters which are not allowed are #,$,%,&,(,),[,],{,},<,>,?,=,+,;,Σ,_,' etc.
I am very new to ERLANG and TSung, I never worked in this areas, but I am very much keen to know the fundamentals and do distributed load test for my web application. I am in half the way to complete, but I have a big hurdle and not able to moving forward , please read below tsung.xml file and advise me where & what I am missing?
**===> tsung.xml (this file perfectly working without any errors)**
*<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel = "debug" dumptraffic="true" version="1.0">
<clients>
<client host="localhost" weight ="1" maxusers="40000" cpu = "1" >
<ip value = '127.000.000.111'/>
</client>
</clients>
<servers>
<server host="127.000.000.112" port="80" type="tcp"></server>
</servers>
<load duration="1" unit="minute">
<arrivalphase phase="1" duration="1" unit="minute">
<users arrivalrate="10" unit="second"></users>
</arrivalphase>
</load>
<sessions>
<session name="mySession" probability="100" type="ts_http">
<transaction name="trx">
<request>
<dyn_variable name="myId" re="<myId>(\.*)\</myId>"/> <-- Trying with RegExp option, not getting the value myId
<!--dyn_variable name="myId" xpath="//response/myId" /--> <-- Trying with xpath option, not getting the value myId
<!--dyn_variable name="myId" jsonpath="response.myId" /--> <-- Trying with jsonpath option, not getting the value myId
<http url='http://127.000.000.112/Create_Rec' method='POST' version='1.1' content_type='text/xml'/>
</request>
<request subst="true">
<http url='http://999.000.000.999/Get_Rec/myId=%%_myId%%' method='GET' version='1.1' content_type='application/xml'/>
</request>
</transaction>
</session>
</sessions>
</tsung>*
When I run this url (it is web service call) "http://_127.000.000.112/Create_Rec" in the web browser, I get the following similar response from Server (in the back ground it creates the record in database and generates new id i.e. myId). When I run above tsung.xml, the first request working perfectly fine as I expected.
===> response (browser response)
<response id="SomeWebService">
<status>
<statusCode>1</statusCode>
<statusMsg>SomeMessage</statusMsg>
<statusTime>2013-06-20 02:52:25</statusTime>
</status>
<myId>298346728934734987</myId>
</response>
What I am looking here, I need to grab the myId from first request and pass into second request myId=%%_myId%%, but it is never working and myId always empty string. I am beyond of dyn_variable since two days, no clue and proper examples/documentation on it. Please suggest me, what I am missing.
You will have to set up the subst="true" in your request for substitution to work. So, your request should change to..
<request subst="true">
If still it doesn't work then I would suggest you to see the tsung.dump file and check the response which you are getting from server
I'm quiet new to WCF world.
I've been looking and trying to understand the WSDL file being generated by WCF. the reason I'm looking is that our clients with Java and PHP are having issue importing the WSDL.
Could anyone please kindly help me with following queries:
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/EvalServiceLibrary" />
</xsd:schema>
Query 1
Based on what condition is above import schemalocation tags gets generated? Is it based on number of data contracts and members or somethingelse (what is it?)
- <wsdl:message name="IEvalService_SubmitEval_InputMessage">
<wsdl:part name="parameters" element="tns:SubmitEval" />
</wsdl:message>
- <wsdl:message name="IEvalService_SubmitEval_OutputMessage">
<wsdl:part name="parameters" element="tns:SubmitEvalResponse" />
</wsdl:message>
Query 2:
I don't have any message name IEvalService_SubmitEval_InputMessage. How is above being generated? Also what is part name and element?
<wsdl:portType name="IEvalService">
- <wsdl:operation name="SubmitEval">
<wsdl:input wsaw:Action="http://tempuri.org/IEvalService/SubmitEval" message="tns:IEvalService_SubmitEval_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IEvalService/SubmitEvalResponse" message="tns:IEvalService_SubmitEval_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
Query 3:
could yo uplease tell me what is "tns:IEvalService_SubmitEval_InputMessage" on above wsdl snippet?
Fianally:
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org
/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org
/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
is thre any way to remove the above unnecessary namespace from WCF code? I only know how to change the namespace.
Thank you heaps.
This part depends on number of assemblies involved. The first line represents your service assembly, second line is always included - that some MS predefined elements (but still valid interoperable XSD) and the third line is probably library with your data contracts.
The default pattern is ServiceContractName_OperationContractName_X where X is either InputMessage or OutputMessage to differ between request and response. Part defines content of the message and element is reference to XSD scheme - that element will be defined in first or second schema import from your first question.
tns probably stands for target namespace - it is a prefix of elements defined in your WSDL document. It is just reference to message defined in your second question.
With default stuff no. You would probably need custom encoder.
What errors do your clients have when importing the WSDL? All these parts are valid.
When I import a given service using "Add service Reference" on Visual Studio 2008 (SP1) all the Request/Response messages are being unnecessarily wrapped into Message Contracts (named as --> "operationName" + "Request"/"Response" + "1" at the end).
The code generator says:
// CODEGEN: Generating message contract since the operation XXX is neither RPC nor
// document wrapped.
The guys who are generating the wsdl from a Java service say they are specifying DOCUMENT-LITERAL/WRAPPED.
Any help/pointer/clue would be highly appreciated.
Update:
this is a sample of my wsdl for one of the operations that look suspicious. Note the mismatch on the message element attribute for the request, compared to the response.
<!- imports namespaces and defines elements -->
<wsdl:types>
<xsd:schema targetNamespace="http://WHATEVER/" xmlns:xsd_1="http://WHATEVER_1/" xmlns:xsd_2="http://WHATEVER_2/">
<xsd:import namespace="http://WHATEVER_1/" schemaLocation="WHATEVER_1.xsd"/>
<xsd:import namespace="http://WHATEVER_2/" schemaLocation="WHATEVER_2.xsd"/>
<xsd:element name="myOperationResponse" type="xsd_1:MyOperationResponse"/>
<xsd:element name="myOperation" type="xsd_1:MyOperationRequest"/>
</xsd:schema>
</wsdl:types>
<!- declares messages - NOTE the mismatch on the request element attribute compared to response -->
<wsdl:message name="myOperationRequest">
<wsdl:part element="tns:myOperation" name="request"/>
</wsdl:message>
<wsdl:message name="myOperationResponse">
<wsdl:part element="tns:myOperationResponse" name="response"/>
</wsdl:message>
<!- operations -->
<wsdl:portType name="MyService">
<wsdl:operation name="myOperation">
<wsdl:input message="tns:myOperationRequest"/>
<wsdl:output message="tns:myOperationResponse"/>
<wsdl:fault message="tns:myOperationFault" name="myOperationFault"/>
<wsdl:fault message="tns:myOperationFault1" name="myOperationFault1"/>
</wsdl:operation>
</wsdl:portType>
Update 2: I pulled all the types that I had in my imported namespace (they were in a separate xsd) into the wsdl, as I suspected the import could be triggering the message contract generation. To my surprise it was not the case and having all the types defined in the wsdl did not change anything.
I then (out of desperation) started constructing wsdls from scratch and playing with the maxOccurs attributes of element attributes contained in a sequence attribute I was able to reproduce the undesired message contract generation behavior.
Here's a sample of an element:
<xsd:element name="myElement">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="arg1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Playing with maxOccurs on elements that are used as messages (all requests and responses basically) the following happens:
maxOccurs = "1" does not trigger the wrapping
macOcccurs > 1 triggers the wrapping
maxOccurs = "unbounded" triggers the wrapping
I was not able to reproduce this on my production wsdl yet because the nesting of the types goes very deep, and it's gonna take me time to inspect it thoroughly. In the meanwhile I am hoping it might ring a bell - any help highly appreciated.
I had this same issue and this solved it.
I used this:
<wsdl:message name="Method">
<wsdl:part name="parameters" element="s0:Method"/>
</wsdl:message>
<wsdl:message name="MethodResponse">
<wsdl:part name="parameters" element="s0:MethodResponse"/>
</wsdl:message>
Instead of:
<wsdl:message name="Method">
<wsdl:part name="request" element="s0:Method"/>
</wsdl:message>
<wsdl:message name="MethodResponse">
<wsdl:part name="response" element="s0:MethodResponse"/>
</wsdl:message>
I believe someone mentioned it before but I can't upVote their answer yet!
Here is another item to check:
Right click on your service reference in the Solution Explorer and select 'Configure Service Reference'
Check whether or not 'Always generate message contracts' is checked.
Have you tried changing the WSDL so that for every instance of part element="tns:myOperation" name="request", changing the value of the name attribute to 'parameters'.
Did you try using the scvutil
Goto --> Startmenu / Visual Studio 2008 / Tools / VS Command Prompt
Type svcutil, then check out the parameters, especially the /wrapped parameter. Eventually use this to generate your proxy, it gives you alot more control over whats going on
While I know this is a long out dated entry, for those that stumble on this same issue:
Double check that the proxy that was generated doesn't contain any jagged arrays, e.g.
(C#)
private string[][] mystring;
(VB.NET)
Private myString()() As String