Getting empty fields in a https call

Hi,

we are using https communication, while we are getting the data from external system in the input we found some tags as empty.
for ex in our xml we have 9 tags so if we are getting 7 tags and not getting the 2 tags we are getting null values in the mapping.

Please find the document attached

Regards,
Sharekhan


mapping error.doc (23.5 KB)

First, you didn’t mention anything about web services, so this may be in the wrong forum. We’ll assume for the moment that this is a POX service (plain 'ole XML).

First you have to decide if the document you are receiving conforms to a schema. If so, you should validate it against that schema and return exceptions if it does not conform.

If the XML document you are receiving is supposed to adhere to a schema and these fields are required then omitting the tags is only legal if they are xs:strings as that implies empty string.

Hope that gets you started,

Mark

Thanks for your quick reply.

We are not using webservices for communication, we have given our end point where we get soap messages the input message structure is in the following format:

<?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=“http://soap.xyz.com/2005/09/outbound”>
00D200000005nIkEAI
04k20000000008FAAQ
6U4oOz7XvSESoEsgj5hvgeJBl0kYHeZpSpvmMcV.3EgJqPh4nReUlFouprhWRKIoBkie2igCzBcLOPcc4uJ2q99cZ0kq0i_9v7_t1zlS.2WVdE.PT82iPbnCXkvRirRwBuyJGwCU
https://eu0-api.xyz.com/services/Soap/c/8.0
https://eu0-api.xyz.com/services/Soap/u/8.0

04l20000000TUulAAG

sf:Id00120000006sIsyAAE</sf:Id>
sf:Account_Status__cActive</sf:Account_Status__c>
sf:Address_Line_1__cstaestrert</sf:Address_Line_1__c>
sf:Address_Line_2__certert</sf:Address_Line_2__c>
sf:Address_Line_3__certyert</sf:Address_Line_3__c>
sf:Country__cYemen</sf:Country__c>
dfgsdgfsdfgdg
sf:Fax2342342</sf:Fax>
sf:IMO_Code__c56df</sf:IMO_Code__c>
sf:NameTest Jon Brayshaw</sf:Name>
sf:Phone2342423</sf:Phone>
sf:Role__cOwner</sf:Role__c>
sf:SAP_Customer_ID__c10345534</sf:SAP_Customer_ID__c>



</soapenv:Body>
</soapenv:Envelope>

we have defined a input document type with this xml.
Then a node is given in service input.
after that xml node to document.
in which we are not getting the entire xml structure since we are receiving the input in the following format
of which the data in tag is not mandatory

but we are getting the data in this format

<?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=“http://soap.xyz.com/2005/09/outbound”>
00D200000005nIkEAI
04k20000000008FAAQ
6U4oOz7XvSESoEsgj5hvgeJBl0kYHeZpSpvmMcV.3EgJqPh4nReUlFouprhWRKIoBkie2igCzBcLOPcc4uJ2q99cZ0kq0i_9v7_t1zlS.2WVdE.PT82iPbnCXkvRirRwBuyJGwCU
https://eu0-api.xyz.com/services/Soap/c/8.0
https://eu0-api.xyz.com/services/Soap/u/8.0

04l20000000TUulAAG

sf:Id00120000006sIsyAAE</sf:Id>
sf:Account_Status__cActive</sf:Account_Status__c>
sf:Address_Line_1__cstaestrert</sf:Address_Line_1__c>
sf:Address_Line_2__certert</sf:Address_Line_2__c>
sf:Address_Line_3__certyert</sf:Address_Line_3__c>
sf:Country__cYemen</sf:Country__c>
dfgsdgfsdfgdg
sf:Fax2342342</sf:Fax>
sf:IMO_Code__c56df</sf:IMO_Code__c>



</soapenv:Body>
</soapenv:Envelope>

So some of the tags are missing due to which mapping is failing.

could you please help us in this regard, if possible let us know how to validate input xml structure.

Regards,
sharekhan

It appears that your trading partner is sending you a soap request for an outbound (to them) notification. The “notifications” tag inside the body of the Soap request contains the data you are looking for.

I would ask your partner for a WSDL that describes the Web Service that the “notifications” operation belongs to. That WSDL will either define a schema that decribes the notifications message in its “wsdl:types” section or import another XSD that does so.

You will need to create a Flow service and then expose it as either a document/literal or SOAP-RPC web service depending on how the operation is described in the partner’s WSDL. In essence, they are asking you to provide a web service to receive their outbound notifications. IS 7.1 makes this much easier by letting you generate a web services descriptor in the “provider” role.

To validate a document against a schema, first create an Integration Server schema from the XSD. If the partner’s WSDL does not import an XSD, you might need to make a simple one and paste in the definition from the wsdl:types/xs:schema section that contains the “notifications” element definition.

You should not create a IS doc type that includes the SOAP envelope, but instead create a doc type that corresponds to the “notifications” element. Then use the pub.soap.utils:getBody built-in service to get a node containing just the payload of the soap message and convert that node into an IS document using pub.xml:xmlNodeToDocument specifying the fully-qualified name of the doc type you create for “notifications”.

If you do this, you can then use pub.schema:validate to validate the node created from the getBody call against the fully qualified name of the IS schema created from the XSD. If the “isValid” output parameter is true, then the document inside the soap body is valid. If not, you should throw an exception which will be returned as a SOAP fault.

Finally, the SOAP Developer’s Guide and Web Services Developer’s Guide located in the webm_home\Developer\doc\guides folder are required reading if you will be working with web services in IS.

Good luck,

Mark