WNS template registration gets rejected from Azure Notification Hubs - azure-notificationhub

I'm sending create or update template registration requests to my Azure Notification Hub using the REST API, but my requests always get rejected for template registrations for Windows Notification Service while it works for all other service types.
The body of my request looks correct to me, when I compare it with the documentation:
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<content type="application/xml">
<WindowsTemplateRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
<Tags>SomeTag:1,TEST_REGISTRATION</Tags>
<ChannelUri>https://db3.notify.windows.com/?token=AgY7AABrfRCVgRV%2ba4DwoDjC2omrnOVwCkdhCrrzlJi6UpIwHzcig6%2fG5xZfnDqU0%2fXoE848ddiqyTaTlSSltp2Dn9Z3qaPsMAyh7kS%2bmlis1%2bwoh%2b%2b4DsAK1yeV1d9G1rUIuFs%3s</ChannelUri>
<BodyTemplate><![CDATA[<?xml version="1.0" encoding="utf-8" ?><data><title>$(title_en)</title><message>$(message_en)</message><notificationType>1</notificationType></data>]]></BodyTemplate>
<WnsHeaders>
<WNSHeader>
<Header>X-WNS-Type</Header>
<Value>wns/raw</Value>
</WNSHeader>
</WnsHeaders>
</WindowsTemplateRegistrationDescription>
</content>
</entry>
ANH always returns the response code 400 (Invalid request body. The registration could not be created because the request was malformed.), but using this format works for all other service types (e.g. GCM, MPNS) and I can create a WNS template registration manually using the Service Bus Explorer with the exact same ChannelUri, template and WnsHeaders.
What else could be wrong here? Is there any way to debug this?

Found the answer in this question: What does the following Azure Notification Hub REST response mean: 'The specified resource description is invalid.'?
"WNSHeader" needs to be written in Pascal case, like this: "WnsHeader", so the documentation is not 100% correct...

Related

RPC Request for get-schema of bbf(broadband forum) yangs

I am trying below RPC request for module bbf-dot1q-types. but facing error like identifier is not found.
Please help me on this to what is the right RPC request for bbf yangs.
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
<identifier>bbf-dot1q-types</identifier>
</get-schema>
</rpc>
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>application</error-type>
<error-tag>invalid-value</error-tag>
<error-severity>error</error-severity>
<error-info>
<err-element>identifier</err-element>
</error-info>
<error-message>
MINOR: MGMT_CORE #2301: Invalid element value
</error-message>
</rpc-error>
</rpc-reply>
Seems like the Netconf server handling your request does not have the bbf-dot1q-types module loaded. See RFC 6022, 3.1. The <get-schema> Operation:
If the requested schema does not exist, the <error-tag> is 'invalid-value'.
Make sure the Netconf server loads the module.

How can I add WS-A adressing to a SOAP webservice-request via Robot Framework?

I am new with Robot Framework and I run into a problem.
I try to call a web service that requires WSA (Web Service Addressing).
I tried sending a request while using SoapUI.
Sending a request via SoapUI provides a <wsa:Action>, a <wsa:RelatesTo> and a <wsa:MessageID> tag in the header when WSA is enabled.
Now I want to do the same with RobotFramework.
How can I inject these same tags via Robot Framework?
Here is my test
*** Settings ***
Library SudsLibrary
Library Collections
Library String
*** Test Cases ***
test
[Tags] blah
Create Soap Client C:${/}Robot WS${/}WS${/}wsdl${/}C60W30A.wsdl
Set Http Authentication MyUID MyPWD
${C60W30A}= Create Wsdl Object ns0:Invoer
${taimen}= Set Soap Headers "wsa:Action" GenBetKenmOperation
Set Wsdl Object Attribute ${C60W30A} Functie 04
Set Wsdl Object Attribute ${C60W30A} Bronsysteem COA
Set Wsdl Object Attribute ${C60W30A} Gebruiker WILLT10
${result}= Call Soap Method GenBetKenmOperation ${C60W30A}
Where the resulting XML is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.MyCompany.nl/inning/coa/GenererenBetKenmerk" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns0:Body>
<ns1:GenererenBetKenm>
<Invoer>
<Functie>04</Functie>
<Bronsysteem>COA</Bronsysteem>
<Gebruiker>GeBrID</Gebruiker>
</Invoer>
</ns1:GenererenBetKenm>
</ns0:Body>
</SOAP-ENV:Envelope>
And the error:
FAIL : WebFault: Server raised fault: 'A required header representing a Message Addressing Property is not present'
As you can see the <wsa:Action> tag is missing. As wel are the other SOAP-header tags when I add them.

Plivo Inbound Sip trunk - issue with destination number

I'm trying to forward calls from few Plivo numbers to my Asterisk server. In Plivo documentation specified, that i have to build Inbound trunk application and return to plivo XML code below:
<Response>
<Dial callerId="18004321321">
<User>sip:yoda12312312#phone.plivo.com</User>
</Dial>
</Response>
But the problem is that i need to add information about destination phone number (cause i have few of them), but can't find the way to do this.
Have you tried this:
<Response>
<Dial callerId="18004321321">
<User>sip:yoda12312312#phone.plivo.com</User>
<Number>180012345678</Number>
</Dial>
</Response>

JMeter changing my namespace

I'm trying to use JMeter to invoke a RPC/SOAP Web service and when I invoke the service my namespaces are mangled from the actual values to NS1.
<?xml version="1.0" encoding="UTF-8"?>
<wpc:invoke xmlns:wpc="http://wpc.ibm.com">
<wpc:envelope communicationVersion="5.3">
<wpc:WPCResponseType>asynchronous</wpc:WPCResponseType>
<wpc:wpcHeader>
<wpc:companyName>mycompany</wpc:companyName>
<wpc:wpsUserID>me</wpc:wpsUserID>
<wpc:wpcUserID>wpcUsername</wpc:wpcUserID>
<wpc:password />
<wpc:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</wpc:messageIdentifier>
<wpc:timestamp>2016-01-18</wpc:timestamp>
<wpc:supplierId><![CDATA[0Z188]]></wpc:supplierId>
<wpc:localeForDisplay>en_US</wpc:localeForDisplay>
<wpc:localeRestriction>en_US</wpc:localeRestriction>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcCommand mode="ASYNC" type="UPLOAD">
<wpc:wpcCatalogName>Item Transaction Catalog</wpc:wpcCatalogName>
<wpc:wpcFileDocStorePath>test_data/upload/0003_items.csv</wpc:wpcFileDocStorePath>
<wpc:wpcUpdateOnly>false</wpc:wpcUpdateOnly>
</wpc:wpcCommand>
</wpc:wpcBody>
</wpc:envelope>
</wpc:invoke>
Changes to:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:invoke xmlns:ns1="http://wpc.ibm.com">
<ns1:envelope communicationVersion="5.3">
<ns1:WPCResponseType>asynchronous</ns1:WPCResponseType>
<ns1:wpcHeader>
<ns1:companyName>mycompany</ns1:companyName>
<ns1:wpsUserID>me</ns1:wpsUserID>
<ns1:wpcUserID>wpcUsername</ns1:wpcUserID>
<ns1:password/>
<ns1:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</ns1:messageIdentifier>
<ns1:timestamp>2016-01-18</ns1:timestamp>
<ns1:supplierId><![CDATA[0Z188]]></ns1:supplierId>
<ns1:localeForDisplay>en_US</ns1:localeForDisplay>
<ns1:localeRestriction>en_US</ns1:localeRestriction>
</ns1:wpcHeader>
<ns1:wpcBody>
<ns1:wpcCommand mode="ASYNC" type="UPLOAD">
<ns1:wpcCatalogName>Item Transaction Catalog</ns1:wpcCatalogName>
<ns1:wpcFileDocStorePath>test_data/upload/0003_items.csv</ns1:wpcFileDocStorePath>
<ns1:wpcUpdateOnly>false</ns1:wpcUpdateOnly>
</ns1:wpcCommand>
</ns1:wpcBody>
</ns1:envelope>
</ns1:invoke>
There must be a setting in JMeter to keep the message from being transformed from my original meaningful namespace to this arbitrary namespace called NS1? When the message is received at the target endpoint it cannot parse the request because of this semantic error.
Any/all replies are appreciated!
MG
JMeter should not change anything in the request body, maybe it is an issues with your web service? Double check the request which is being sent by JMeter using a sniffer tool like Wireshark
In any case try switching to HTTP Request sampler, this is recommended way of sending web service requests (just don't forget to add HTTP Header Manager to send Content-Type and SOAPAction headers).
References:
JMeter User's Manual: Building a SOAP WebService Test Plan
Testing SOAP/REST Web Services Using JMeter

iphone calling web service with manually encrypted message

I'm developing an ios app which will invoke a web service operation. The existing web service is configured with wsHttpBinding security set as TransportWithMessageCredential.
I've used wsdl2objc to generate the implementation files (from wsdl) and have setup a small app for testing purposes. I'm not able to get the app to talk to the web service correctly though, and from what I've read it seems virtually impossible with these web config settings (wsHttpBinding, Transport and Message security).
I've done quite a bit of research, and with the help of information found on this site (and others), I've managed to find out what SOAP requests should look like. I basically used WCF Test Client with Fiddler monitoring the traffic. I also tried soapUI, which wasn't as successful as I'd hoped.
I did setup a test web service locally and I can successfully consume, but only when the web config has security using BasicHttpBinding or wsHttpBinding security mode = "none" (which I understand is just like basicHttpBinding).
My solution (I hope) is...what if I write a web service to call this web service? Both web services will reside on the server, but the one the iphone will consume is configured with SSL. The idea is then to manually encrypt the operation (and necessary attributes) using an ios security framework (HMAC) or other hashing algorythm, and have the SSL web service decrypt and then invoke the requested operation from the existing web service. Does this make sense? I'm thinking this seems too simple, that I must be missing something. Does anyone see any real problem with this?
Thanks.
Edit I just wanted to clarify my situation a little: My app is not able to consume the existing web service as it is configured. My thought was to create a web service which will talk with this one. The new web service will simply decrypt the incoming data and invoke a method on the existing web service. Once a response is received, the new web service will encrypt the data and send it back to the iphone app. Sorry if I'm not being clear.
Update
Here is the soap envelope (from Fiddler):
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">http://tempuri.org/IService/ValidateMe</a:Action>
<a:MessageID>urn:uuid:81d70393-5356-4e3a-b209-49ea53068935</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">https://mibe.stpa.com/WCFService/IVService.svc/ValidationService</a:To>
<o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
<u:Timestamp u:Id="_0">
<u:Created>2013-02-10T04:48:18.646Z</u:Created>
<u:Expires>2013-02-10T04:53:18.646Z</u:Expires>
</u:Timestamp>
<c:SecurityContextToken xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" u:Id="uuid-0191ec20-905d-4ef0-a818-3eced0e02ecf-32">
<c:Identifier>urn:uuid:06bd1d3e-97e5-41bc-afce-3993736f202d</c:Identifier>
</c:SecurityContextToken>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
<Reference URI="#_0">
<Transforms>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>/RpEprwYbnSypHXVF/rdxn3nkRo=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>ya8hHooO129dNOHplhY3xRndoDk=</SignatureValue>
<KeyInfo>
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" URI="#uuid-0191ec20-905d-4ef0-a818-3eced0e02ecf-32"/>
</o:SecurityTokenReference>
</KeyInfo>
</Signature>
</o:Security>
</s:Header>
<s:Body>
<ValidateMe xmlns="http://tempuri.org/">
<memberId>950470173</memberId>
</ValidateMe>
</s:Body>
</s:Envelope>