Adding a tenant via SOAP API throws error - wso2

I am using APIM 3.1.0. I need to add the new tenant to the system for that I am using SOAP APIs. I am sending the request.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:addTenant>
<!--Optional:-->
<ser:tenantInfoBean>
<xsd:active>true</xsd:active>
<xsd:adminFirstName>vk</xsd:adminFirstName>
<xsd:adminFullName>fname</xsd:adminFullName>
<xsd:adminLastName>k</xsd:adminLastName>
<xsd:adminName>soapadmin</xsd:adminName>
<xsd:adminPassword>11111</xsd:adminPassword>
<xsd:createdDate>2020-07-08T11:30:00+05:30</xsd:createdDate>
<xsd:domain>mydomain.com</xsd:domain>
<xsd:email>vk#abc.com</xsd:email>
<xsd:id>15</xsd:id>
<xsd:realmConfig></xsd:realmConfig>
</ser:tenantInfoBean>
</ser:addTenant>
</soapenv:Body>
</soapenv:Envelope>
But for this I am receiving the response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Provided domain name is empty.</faultstring>
<detail>
<ns:TenantMgtAdminServiceException xmlns:ns="http://services.mgt.tenant.carbon.wso2.org">
<ns:TenantMgtAdminServiceException>
<axis2ns2:Message xmlns:axis2ns2="http://services.mgt.tenant.carbon.wso2.org">Provided domain name is empty.</axis2ns2:Message>
</ns:TenantMgtAdminServiceException>
</ns:TenantMgtAdminServiceException>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Why I am getting Provided domain name is empty, when I have passed the domain name correctly?
UPDATE
Now I changed the request as suggested but I am getting the Unknown error.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:addTenant>
<!--Optional:-->
<ser:tenantInfoBean>
<!--Optional:-->
<xsd:active>true</xsd:active>
<!--Optional:-->
<xsd:admin>testadmin</xsd:admin>
<!--Optional:-->
<xsd:adminPassword>12345</xsd:adminPassword>
<!--Optional:-->
<xsd:createdDate>2020-07-08T11:30:00+05:30</xsd:createdDate>
<!--Optional:-->
<xsd:email>vk#abc.com</xsd:email>
<!--Optional:-->
<xsd:firstname>fname</xsd:firstname>
<!--Optional:-->
<xsd:lastname>lname</xsd:lastname>
<!--Optional:-->
<xsd:originatedService></xsd:originatedService>
<!--Optional:-->
<xsd:successKey></xsd:successKey>
<!--Optional:-->
<xsd:tenantDomain>mydomain.com</xsd:tenantDomain>
<!--Optional:-->
<xsd:tenantId>5</xsd:tenantId>
<!--Optional:-->
<xsd:usagePlan>demo</xsd:usagePlan>
</ser:tenantInfoBean>
</ser:addTenant>
</soapenv:Body>
</soapenv:Envelope>
Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>unknown</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
I initially used the same request as you mentioned. But in the WSDL contract the tenant type is
<xs:element minOccurs="0" name="active" type="xs:boolean"/>
<xs:element minOccurs="0" name="adminFirstName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="adminFullName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="adminLastName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="adminName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="adminPassword" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="createdDate" nillable="true" type="xs:date"/>
<xs:element minOccurs="0" name="domain" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="email" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="id" type="xs:int"/>
<xs:element minOccurs="0" name="realmConfig" nillable="true" type="ax2987:RealmConfiguration"/>

addTenant request in https://localhost:9443/services/TenantMgtAdminService?wsdl 1 is as follows. Please try the below request.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd">
<soap:Header/>
<soap:Body>
<ser:addTenant>
<!--Optional:-->
<ser:tenantInfoBean>
<!--Optional:-->
<xsd:active>?</xsd:active>
<!--Optional:-->
<xsd:admin>?</xsd:admin>
<!--Optional:-->
<xsd:adminPassword>?</xsd:adminPassword>
<!--Optional:-->
<xsd:createdDate>?</xsd:createdDate>
<!--Optional:-->
<xsd:email>?</xsd:email>
<!--Optional:-->
<xsd:firstname>?</xsd:firstname>
<!--Optional:-->
<xsd:lastname>?</xsd:lastname>
<!--Optional:-->
<xsd:originatedService>?</xsd:originatedService>
<!--Optional:-->
<xsd:successKey>?</xsd:successKey>
<!--Optional:-->
<xsd:tenantDomain>?</xsd:tenantDomain>
<!--Optional:-->
<xsd:tenantId>?</xsd:tenantId>
<!--Optional:-->
<xsd:usagePlan>?</xsd:usagePlan>
</ser:tenantInfoBean>
</ser:addTenant>
</soap:Body>
</soap:Envelope>
You are getting Provided domain name is empty. error because your request contains <xsd:domain>mydomain.com</xsd:domain> instead of <xsd:tenantDomain>mydomain.com</xsd:tenantDomain>
[1]https://is.docs.wso2.com/en/latest/administer/adding-new-tenants/#managing-tenants-using-admin-services

Related

Sabre Webservice to create Session using SoapUI 5.2.0

I am trying to get token and then session in Sabre Production using SessionCreateRQ but getting error "Invalid or Expired binary security token ".
Endpoints: https://webservices.havail.sabre.com/websvc and https://sws-crt.cert.havail.sabre.com
I have an EPR which works in both Prod and cert but defaults to Prod.
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:mes="http://www.ebxml.org/namespaces/messageHeader" xmlns:web="http://webservices.sabre.com">
<soapenv:Header>
<sec:Security>
<!--Optional:-->
<sec:UsernameToken>
<!--Optional:-->
<sec:Username>*****</sec:Username>
<!--Optional:-->
<sec:Password>*******</sec:Password>
<!--0 to 2 repetitions:-->
<sec:NewPassword>******</sec:NewPassword>
<!--Optional:-->
<Organization>IPCC</Organization>
<!--Optional:-->
<Domain></Domain>
</sec:UsernameToken>
<!--Optional:-->
<sec:SabreAth>?</sec:SabreAth>
<!--Optional:-->
<sec:BinarySecurityToken>?</sec:BinarySecurityToken>
</sec:Security>
<mes:MessageHeader mes:id="?" mes:version="?">
<mes:From>
<!--1 or more repetitions:-->
<mes:PartyId mes:type="?">?</mes:PartyId>
<!--Optional:-->
<mes:Role>?</mes:Role>
</mes:From>
<mes:To>
<!--1 or more repetitions:-->
<mes:PartyId mes:type="?">?</mes:PartyId>
<!--Optional:-->
<mes:Role>?</mes:Role>
</mes:To>
<mes:CPAId>?</mes:CPAId>
<mes:ConversationId>?</mes:ConversationId>
<mes:Service mes:type="?">TokenCreateRQ</mes:Service>
<mes:Action>TokenCreateRQ</mes:Action>
<mes:MessageData>
<mes:MessageId>?</mes:MessageId>
<mes:Timestamp>?</mes:Timestamp>
<!--Optional:-->
<mes:RefToMessageId>?</mes:RefToMessageId>
<!--Optional:-->
<mes:TimeToLive>?</mes:TimeToLive>
<!--Optional:-->
<mes:Timeout>3000</mes:Timeout>
</mes:MessageData>
<!--Optional:-->
<mes:DuplicateElimination>?</mes:DuplicateElimination>
<!--Zero or more repetitions:-->
<mes:Description xml:lang="?">?</mes:Description>
<!--You may enter ANY elements at this point-->
</mes:MessageHeader>
</soapenv:Header>
<soapenv:Body>
<web:TokenCreateRQ Version="?"/>
</soapenv:Body>
</soapenv:Envelope>
Response:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<eb:MessageHeader eb:version="1.0" soap-env:mustUnderstand="1" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader">
<eb:From>
<eb:PartyId eb:type="?">?</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="?">?</eb:PartyId>
</eb:To>
<eb:CPAId>?</eb:CPAId>
<eb:ConversationId>?</eb:ConversationId>
<eb:Service eb:type="?">TokenCreateRQ</eb:Service>
<eb:Action>ErrorRS</eb:Action>
<eb:MessageData>
<eb:MessageId>1467037801397820233</eb:MessageId>
<eb:Timestamp>2021-02-17T22:15:39</eb:Timestamp>
<eb:RefToMessageId>?</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">?</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<soap-env:Fault>
<faultcode>soap-env:Client.InvalidSecurityToken</faultcode>
<faultstring>Invalid or Expired binary security token: ?</faultstring>
<detail>
<StackTrace>com.sabre.universalservices.base.session.SessionException: errors.session.USG_INVALID_SECURITY_TOKEN</StackTrace>
</detail>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>
Please help me what is wrong here? I know my EPR working fine.
You can use this snippet for TokenCreateRQ
https://developer.sabre.com/docs/soap_apis/session_management/create_access_token
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext"
xmlns:eb="http://www.ebxml.org/namespaces/messageHeader"
xmlns:web="http://webservices.sabre.com">
<soapenv:Header>
<sec:Security>
<!--Optional:-->
<sec:UsernameToken>
<sec:Username>${#Project#Username}</sec:Username>
<sec:Password>${#Project#Password}</sec:Password>
<Organization>${#Project#Organization}</Organization>
<Domain>${#Project#Domain}</Domain>
</sec:UsernameToken>
</sec:Security>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1">
<eb:From>
<eb:PartyId>Client</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId>SWS</eb:PartyId>
</eb:To>
<eb:CPAId>${#Project#Organization}</eb:CPAId>
<eb:ConversationId>1234</eb:ConversationId>
<eb:Service>Session</eb:Service>
<eb:Action>TokenCreateRQ</eb:Action>
<eb:MessageData>
<eb:MessageId>1234</eb:MessageId>
<eb:Timestamp>2015-01-01T00:00:00</eb:Timestamp>
</eb:MessageData>
</eb:MessageHeader>
</soapenv:Header>
<soapenv:Body>
<web:TokenCreateRQ Version="2.0.0"/>
</soapenv:Body>
</soapenv:Envelope>
HTH

Building SOAP request from WSDL

I need to execute a SOAP request to an external server. I have never worked with SOAP before, but I know the basics of REST.
I've been given this following WSDL file and this example query:
<Messages>
<Version Ds_Version="0.0">
<Message>
<Detail>
<Ds_MerchantCode>999008881</Ds_MerchantCode>
<Ds_Terminal>1</Ds_Terminal>
<Ds_Order>5799L</Ds_Order>
<Ds_TransactionType>3</Ds_TransactionType>
</Detail>
</Message>
</Version>
<Signature>UfECD0KD9Wwo1iqY6PYZoJxw8KwMUz8m18bgLyH3BCI=</Signature>
<SignatureVersion>HMAC_SHA256_V1</SignatureVersion>
</Messages>
I'm using Postman in order to test the API. Following some instructions I found on the internet, I added a Content-Type HTTP header with value text/xml and the SOAPAction HTTP header with value consultaOperaciones as found in the WSDL file.
I've set this body:
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body xmlns:m="http://webservices.apl02.redsys.es">
<m:consultaOperacionesRequest>
<Messages>
<Version Ds_Version="0.0">
<Message>
<Transaction>
<Ds_MerchantCode>999008881</Ds_MerchantCode>
<Ds_Terminal>1</Ds_Terminal>
<Ds_Order>5799L</Ds_Order>
<Ds_TransactionType>3</Ds_TransactionType>
</Transaction>
</Message>
</Version>
<Signature>1KoxTgTakbTprzJ2N/e9JJ8yw/C3QzeNafbUMCNGSFM=</Signature>
<SignatureVersion>HMAC_SHA256_V1</SignatureVersion>
</Messages>
</m:consultaOperacionesRequest>
</soap:Body>
</soap:Envelope>
However, when I send the request I receive the following error message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Internal Error</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
It's a generic SOAP error message, therefore I think that the problem has to be related to the codification instead of the external service.
Thanks in advance.
In the WSDL file you will see that the XML should be sent as a string:
<element name="consultaOperaciones">
<complexType>
<sequence>
<element name="cadenaXML" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
Hence the XML sent should be:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.apl02.redsys.es">
<soapenv:Header/>
<soapenv:Body>
<web:consultaOperaciones>
<cadenaXML><![CDATA[
<Messages>
<Version Ds_Version="0.0">
<Message>
<Detail>
<Ds_MerchantCode>999008881</Ds_MerchantCode>
<Ds_Terminal>1</Ds_Terminal>
<Ds_Order>5799L</Ds_Order>
<Ds_TransactionType>3</Ds_TransactionType>
</Detail>
</Message>
</Version>
<Signature>UfECD0KD9Wwo1iqY6PYZoJxw8KwMUz8m18bgLyH3BCI=</Signature>
<SignatureVersion>HMAC_SHA256_V1</SignatureVersion>
</Messages>
]]>
</cadenaXML>
</web:consultaOperaciones>
</soapenv:Body>
</soapenv:Envelope>
Note that we are using CDATA because as mentioned the XML message should be sent as a string based on the WSDL. I have tried running it and got the response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p259:consultaOperacionesResponse xmlns:p259="http://webservices.apl02.redsys.es">
<consultaOperacionesReturn><![CDATA[<Messages><Version Ds_Version="0.0"><Message><ErrorMsg><Ds_ErrorCode>XML0023</Ds_ErrorCode></ErrorMsg></Message></Version></Messages>]]></consultaOperacionesReturn>
</p259:consultaOperacionesResponse>
</soapenv:Body>
</soapenv:Envelope>
This means that your message is being parsed now because there are no server errors and a consultaOperacionesResponse is being sent which looks legit. The error seems to be related to the data being sent but in general the API is working fine as expected.

How #WebResult annotation works in JAX-WS

I'm trying to create Jax-ws WebServices. But stuck with this behaviour of JAX-WS 2.2.
I wrote the SEI class in the following way
#WebService
#SOAPBinding(parameterStyle=ParameterStyle.WRAPPED,use=Use.LITERAL,style=Style.DOCUMENT)
public class WebServicesServlet{
#WebMethod
public GetServerTimeProperty getServerTimeProperties(){
return new GetServerTimeProperty();
}
}
The generated wsdl for the above SEI is as follows:
<types>
<xsd:schema>
<xsd:import namespace="http://soapCl.test/" schemaLocation="WebServicesService_schema1.xsd"/>
</xsd:schema>
</types>
<message name="getServerTimeProperties">
<part name="parameters" element="tns:getServerTimeProperties"> </part>
</message>
<message name="getServerTimePropertiesResponse">
<part name="parameters" element="tns:getServerTimePropertiesResponse"> </part>
</message>
And the XSD
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapCl.test/" version="1.0" targetNamespace="http://soapCl.test/">
<xs:element name="getTimeProperties" type="tns:getServerTimeProperties"/>
<xs:element name="getTimePropertiesResponse" type="tns:getServerTimePropertiesResponse"/>
<xs:complexType name="getServerTimeProperties">
<xs:sequence/>
</xs:complexType>
**<xs:complexType name="getServerTimePropertiesResponse">**
<xs:sequence>
**<xs:element name="return" type="tns:getServerTimeProperty" minOccurs="0"/>**
</xs:sequence>
</xs:complexType>
<xs:complexType name="getServerTimeProperty">
<xs:sequence>
<xs:element name="dayLightSavingHours" type="xs:int"/>
<xs:element name="observesDayLightSavings" type="xs:boolean"/>
<xs:element name="timeZoneDisplayName" type="xs:string"/>
<xs:element name="timeZoneId" type="xs:string"/>
<xs:element name="timeZoneValue" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
SOAP Response :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<dlwmin:getServerTimePropertiesResponse xmlns:dlwmin="http://soapCl.test/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GetServerTimeProperty>
<dayLightSavingHours>0</dayLightSavingHours>
<observesDayLightSavings>false</observesDayLightSavings>
</GetServerTimeProperty>
</dlwmin:getServerTimePropertiesResponse>
</soapenv:Body>
</soapenv:Envelope>
I've tried to generate stubs using wsimport and this is what I could observe in the generated port class
#WebMethod
**#WebResult(targetNamespace = "")**
#RequestWrapper(localName = "getServerTimeProperties", targetNamespace = "http://soapCl.test/", className = "soapCl.test.GetServerTimeProperties")
#ResponseWrapper(localName = "getServerTimePropertiesResponse", targetNamespace = "http://soapCl.test/", className = "soapCl.test.GetServerTimePropertiesResponse")
#Action(input = "http://soapCl.test/WsSessionEJBEndPoint/getServerTimePropertiesRequest", output = "http://soapCl.test/WsSessionEJBEndPoint/getServerTimePropertiesResponse")
public GetServerTimeProperty getServerTimeProperties();
I'm curious to Know why is the WebResult name different in wsdl as "return" and in soap Response as "GetServerTimeProperty" and in generated stub as "".
Also If I dont annotate the Webmethod with #WebResult(name="GetServerTimeProperty"), my stub-generated client response is null.
If I annotate my webmethod with #WebResult(name="GetServerTimeProperty"), my soapResponse is looking as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns2:getServerTimePropertiesResponse xmlns:ns2="http://soapCl.test/">
<return>
<dayLightSavingHours>0</dayLightSavingHours>
<observesDayLightSavings>false</observesDayLightSavings>
</return>
</ns2:getServerTimePropertiesResponse>
</soapenv:Body>
</soapenv:Envelope>
Is #WebResult(name) is mandatory in jax-ws? I'm curios to Know how this webresult annotation is making a difference in soap response and client response.
Is is that the name should be unique for every "operationName"+"Respone" element ? My wsdl has many elements with same name as
Please Suggest on this why the WebResult name returning soap response as null if we dont annotate
I Further ruled out this
1.When two webmethods methods have same #WebResult(name="A"), the soapResponse result name differs for two methods when I mention
<wsdl-file>web-inf/wsdl/WebService.wsdl</wsdl-file>
explicitly in webservices.xml.
2.The SoapResponse return name is same when I remove the <wsdl-file> entry in webservices.xml. Not sure how wsdl-file tag is making the difference.

XIAdapter Error in Soap UI

I'm trying to submit the request and get the response in SOAP UI but getting the following error.
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body>
<SOAP:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
<context>XIAdapter</context>
<code>ADAPTER.JAVA_EXCEPTION</code>
<text>See log trace with id: n/a</text>
</s:SystemError>
</detail>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>
The request i'm sending is
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:seg="http://intel.com/xi/Intel-MDM/Project/Segment">
<soapenv:Header/>
<soapenv:Body>
<seg:ListSegment_Request>
<!--Optional:-->
<SegmentName></SegmentName>
<!--Optional:-->
<StatusCode></StatusCode>
<!--Optional:-->
<PendingInd></PendingInd>
<!--Optional:-->
<ChangeDateFrom></ChangeDateFrom>
<!--Optional:-->
<ChangeTimeFrom></ChangeTimeFrom>
<!--Optional:-->
<ChangeDateTo></ChangeDateTo>
<!--Optional:-->
<ChangeTimeTo></ChangeTimeTo>
<!--Optional:-->
<List>
<!--Zero or more repetitions:-->
<Item>
<SegmentIdentifier>?</SegmentIdentifier>
</Item>
</List>
</seg:ListSegment_Request>
</soapenv:Body>
</soapenv:Envelope>
Is the issue with server or SOapUI or am i missing something here?

Body namespace declaration in WSDL

I have a soap request declared like so:
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
>
<soap:Body xmlns:myResource="example.org/api/soap/myResource">
<myResource:create_resource>
<myResource:myResourcesList>
<myResource:myResource>
<myResource:title>FIRST TITLE</myResource:title>
</myResource:myResource>
<myResource:myResource>
<myResource:title>SECOND TITLE</myResource:title>
</myResource:myResource>
</myResource:myResourceList>
</myResource:create_resource>
</soap:Body>
</soap:Envelope>
I want to write a WSDL file that would handle such requests. Let's say I have declared basic definitions and models:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions
name="mySoapApi"
targetNamespace="http://example.org/api/soap/?wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding"
xmlns:soap12env="http://www.w3.org/2003/05/soap-envelope"
xmlns:tns="http://example.org/api/soap/?wsdl"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<wsdl:types>
<xs:schema targetNamespace="http://example.org/api/soap/?wsdl">
<xs:complexType name="myResource">
<xs:sequence>
<xs:element name="title" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="myResource" type="tns:myResource"/>
<xs:complexType name="myResourceList">
<xs:sequence>
<xs:element name="myResource" type="tns:myResource" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:element name="myResourceList" type="tns:myResourceList"/>
<xs:complexType name="createMyResourceListResponse">
<xs:sequence>
<xs:element name="myResourceList" type="tns:myResourceList"/>
</xs:sequence>
</xs:complexType>
<xs:element name="createMyResourceListResponse" type="tns:myResourceList"/>
</xs:schema>
</wsdl:types>
I have a few problems with this.
I don't know how to handle the namespace declared in request body tag:
<soap:Body xmlns:myResource="example.org/api/soap/myResource">
<myResource:create_resource>
<myResource:myResourcesList>
<myResource:myResource>
<myResource:title>FIRST TITLE</myResource:title>
</myResource:myResource>
<myResource:myResource>
<myResource:title>SECOND TITLE</myResource:title>
</myResource:myResource>
</myResource:myResourceList>
</myResource:create_resource>
</soap:Body>
I understand, that each Type and operation should be declared in proper namespace in WSDL file. How to do that? How to write WSDL file so in response for this request I would get something like:
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
>
<soap:Body xmlns:myResource="example.org/api/soap/myResource">
<myResource:created_resource>
<myResource:myResourcesList>
<myResource:myResource>
<myResource:title>FIRST TITLE</myResource:title>
</myResource:myResource>
<myResource:myResource>
<myResource:title>SECOND TITLE</myResource:title>
</myResource:myResource>
</myResource:myResourceList>
</myResource:created_resource>
</soap:Body>
</soap:Envelope>
Where the main thing is that myResource:create_resource is changed to myResource:created_resource? (let's say that the logic behind creating resources is executed correctly)