SOAP Request from Siebel has namespace in every element - siebel

In an outbound webservice, I am trying to send a request to another application. Problem is when Siebel sends the request, it is sending namespace parameters in every element of the soap request.
See Below:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body><getAuths xmlns="http://data.service.client.ods.transys.wex.com/">
<authSearch>
<authID xmlns="http://data.service.client.ods.transys.wex.com/"></authID>
</authSearch>
</getAuths>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Whereas If I am trying the same request from SOAP, there is no issue in the SOAP XML that is sent.
I checked a similar blog earlier where there is some name space property to be removed from Integration Object, but I am not able to get rid of the problem.
Can anyone tell me if the IC Field USer property has to be altered or IC User prperty or the IO user property?
Any response for this will be highly appreciated.
Thanks in advance. !
Best Regards,
-N

The IC field user propery has to be retained, do not inactivate it. Instead, delete the text in the value field next to it.
So you will have ICField user property, but blank. This should remove the namespaces.
If this does not work, try inactivating all the IO and ICF user properties which has namespaces in them.

Related

How to use the url that came in response

Help to understand and direct what needs to be done further. I use the robot framework version 3.1.1 and the Python 2.7 programming language to write the autotest script, and now there is a task to develop a test that will work with POST / GET requests. So, I make a POST request to the system to initiate a payment. The answer comes that the payment has been created, but for all actions it is necessary to follow the link inside the answer.
Request:
Create Session allias URL
&{params}= Create Dictionary params1=value1 params2=value2
${resp}= Post Request allias /init_payment.php params=${params}
Should Be Equal As Strings ${resp.status_code} 200
Reply post response:
<?xml version="1.0" encoding="utf-8"?>
<response><pg_status>ok</pg_status><pg_payment_id>3016695</pg_payment_id><pg_redirect_url>https://test.paybox.money/payment.html?customer=028c44bf25b6be251199221d04b570c2</pg_redirect_url><pg_redirect_url_type>need data</pg_redirect_url_type><pg_salt>8OYUsodtnaTWKbOD</pg_salt><pg_sig>a26e61d6eb710c430d67150498d1f555</pg_sig></response>
How to show the framework so that it can go through the redirect url? I would be very grateful for your help.
The RequestsKeywors from the Robot Framework use Requests HTTP Client. Reading the quickstart from this library you can find that the response's contents is available in the text field.
${body}= ${resp.text}
Then you'd most likely want to parse the XML. You can use the XML library for that.
It will be something like
${root} = Parse XML ${body}
${link} = Get Element Text ${root} response/pg_redirect_url

How to access twilio's request from the aws api gateway mapping template?

I want to access my twilio get request (body, method, query etc.) via the aws api gateway but i don't know what to put in my aws api gateway in the mapping template to process it.
Any help will be highly appreciated.
Thanks.
If you want the response from the endpoint to be passed through as-is, you can use pass through mapping. Otherwise, you can use the mapping templates to customize the method response. Here is the Mapping Template Reference for API Gateway. Please let us know if you have any specific questions.
This is the most complete answer for AWS API Gateway to convert a form URL encoded POST, to a JSON payload...
Convert URL Encode to JSON NOTE: Scroll down to the last answer, as there are several updated to account for edge cases.
It's a lot of ceremony, using a language that I've never seen before, but at least it's readable. Far cry IMO from Azure functions where you simply get the request, and then manage it with the language that you are in.
This only gets you half way there however, you also have to add a mapping template to the Integration Response - but that template is simple and is referenced in the previous comment - repeated here for convenience
#set($inputRoot = $input.path('$'))
<?xml version="1.0" encoding="UTF-8"?>
<Response>
$inputRoot
</Response>
Since I'm using only responding to an SMS message - I added the following, and only returned a string from the function:
#set($inputRoot = $input.path('$'))
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
<Body>
$inputRoot
</Body>
</Message>
</Response>

XML Disappears in Script Mediator

I want to add a new child node to an XML request I'm proxying through to WSO2 DSS using an API.
The request I receive is in the following format:
<contacts>
<firstName>Bob</firstName>
<lastName>Brown</lastName>
</contacts>
I need to add an "id" node to this request that I can retrieve from a URI variable.
<contacts>
<id>1</id>
<firstName>Bob</firstName>
<lastName>Brown</firstName>
</contacts>
I've tried using the "enrich" mediator, but this seems to just wrap the ID node around the first name and last name nodes.
So I've resorted to using a script mediator to modify the request. This is what I'd like to do:
//Get XML Request from message context
var request= mc.getPayloadXML();
//Create a child node using standard E4X notation
var child = <id>1</id>;
//Append this XML to the request
request.appendChild(child);
//Replace the payload
mc.setPayloadXML(request);
Every time I try to submit this code, the WSO2 ESB API UI says that everything is cool. But when I check the underlying XML configuration, it is not cool. Where I defined "id" node is now just blank, as if it was filtered without my knowledge!
It would be great if I could add this element using a script mediator, but I'm open to other solutions.
This was actually a pretty easy fix. Just use a CDATA section to have the XML parser ignore your code.
<![CDATA[ //YOUR CODE WITH XML INLINE// ]]>
Note that for some reason the WSO2 ESB XML Editor and UI will remove the CDATA section the next time you open your sequence for editing. I generally just copy out the XML configuration to a text file and paste it back into the configuration whenever it needs to be updated.
Not a perfect solution, but it'll get you over the line.

Questions regarding XML request format

Please consider the following code from Ben Nadel's post:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Subscriber.AddAndResubscribe
xmlns="http://api.createsend.com/api/">
<ApiKey>#campaignMonitorKey#</ApiKey>
<ListID>#campaignMonitorList#</ListID>
<Email>kim#sweet-n-sassy.com</Email>
<Name></Name>
</Subscriber.AddAndResubscribe>
</soap:Body>
</soap:Envelope>
I understood that AddAndResubscribe is the operation name and Subscriber.AddandResubscribe is the input name. I am wondering what does campaignMonitorKey, campaignMonitorList , the value in the Email tag and an empty Name tag means? Could anyone please explain?
Source for WSDL: http://api.createsend.com/api/api.asmx?WSDL
Source for the POST: http://www.bennadel.com/blog/1809-Making-SOAP-Web-Service-Requests-With-ColdFusion-And-CFHTTP.htm
Thanks
In Ben Nadel's post, he's sending data to Campaign Monitor's newsletter subscription API. The structure of the soap body is dictated in this case by Campaign Monitor. What is being passed are the values needed to use their addAResubscribe method.
Since I don't use Campaign Monitor, I'm only making an educated guess here:
ApiKey: I'm assuming is an authentication key you gain when you sign up. This allows Campaign Monitor know who is sending the request, and that the customer is still active. Notice that #campaignMonitorKey#. This value would be set else were in the application. Since it's Ben's ApiKey, the setting of this value was left out of his example.
ListID: would be the ID representing a mailing lists. Once again, this would be set else were in the application, and wasn't shared in the example.
Email: the email being added.
Name would be the name of the person reviving the email.
When consuming soap request myself, I first use an application called SoapUI. This tool can generate sample request bodys for all the methods exposed by the WSDL URL. From here you can try putting in your own values and get a response back.

how to update the files saved in registry

I have saved an xml file in Configuration registry /_system/config/test.xml. My xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<ServiceDefinition>
<Source1001>Endpoint1</Source1001>
<Source1002>Endpoint2</Source1002>
</ServiceDefinition>
Now can i create a proxy to update the contents of the above xml file by use of sequence or class mediator? If i pass new endpoint= Endpoint3 and Node = Source1001 in the request of the proxy. then for the node Source1001 i should be able to see the changed endpoint as Endpoint3
Looking forward to your answers. Thanks in advance.
No built-in mediator can do this. You can write a class mediator to read the xml placed in registry, then save it after editing. You have to get the reference to registry service via osgi at the class mediator for that.
FYI. you can get the input from message context and find the values to replace.
This [1] post explains about creating class mediator to read from registry resource. Hope this will be helpful during your task.
[1] http://vvratha.blogspot.com/2013/02/accessing-registry-resources-from-class.html
You can use the following code segment within a class mediator or you can do the same with script mediator as well.
mc.getConfiguration().getRegistry().updateResource(
resourcePath, mc.getProperty("myProperty").toString().getBytes());
You can find more details on how to use either one of those mediators here