how to move xmlns to envelope WCF - wcf

I have a WCF Web Service, this must accept a request from a other non .net client, my problem is that WCF is especting the soap like this:
<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>
<myMethod xmlns="http://webservices.myServices/">
<param1>ABC</param1>
<param2>123</param2>
</myMethod>
</soapenv:Body>
</soapenv:Envelope>
but the client is sending
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:q0="http://webservices.myServices/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<q0:myMethod>
<param1>ABC</param1>
<param2>123</param2>
</q0:myMethod>
</soapenv:Body>
</soapenv:Envelope>
The only difference is that xmlnamespace is inside the Envelope tag, but for some reason WCF dont understand it.

Related

Sonos applink based authentication issue

Trying to add out sonos service will show Authorize" screen for a fraction of a second before it goes away stating "account not found" before I even have time to put in an account. Below are the request for applink and resonse.
Any thing else is required to make it remain in the authorize screen
//request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
<soapenv:Header>
<ns:context>
</ns:context>
<ns:credentials>
</ns:credentials>
</soapenv:Header>
<soapenv:Body>
<ns:getAppLink>
<ns:householdId>Sonos_ghsAflSonosakevCzmxcmFhN7pN</ns:householdId>
<ns:hardware>iPhone8,2</ns:hardware>
<ns:osVersion>Version 9.3.3 (Build 13G34)</ns:osVersion>
<ns:sonosAppName>ICRU_iPhone8,2</ns:sonosAppName>
<ns:callbackPath>sonos://x-callback-url/addAccount?state=sid%3D61703%26OAuthDeviceID%3DSonos_ghsAflSonosakevCzmxcmFhN7pN%26callbackPath%3D%2FaddAccount</ns:callbackPath>
</ns:getAppLink>
</soapenv:Body>
</soapenv:Envelope>
//response
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://www.sonos.com/Services/1.1">
<soap:Body>
<getAppLinkResponse xmlns="http://www.sonos.com/Services/1.1">
<getAppLinkResult>
<authorizeAccount>
<appUrlStringId>LAUNCH_APP</appUrlStringId>
<deviceLink>
<regUrl>https://ourserver.com/#/signin?callbackurl=sonos://x-callback-url/add…
<linkCode>Sonos_ghsAflSonosakevCzmxcmFhN7pN</linkCode>
<showLinkCode>false</showLinkCode>
</deviceLink>
</authorizeAccount>
</getAppLinkResult>
</getAppLinkResponse>
</soap:Body>
</soap:Envelope>
The experience you are describing is what would happen if you are not properly returning the ‘NOT_LINKED_RETRY’ fault.
As described in the documentation, https://musicpartners.sonos.com/node/405 (search for polling). While your service waits for the user to manually log in through the browser, it should provide to the getDeviceAuthToken call the ‘NOT_LINKED_RETRY’ fault response for a few minutes. Details for this fault can be found here: https://musicpartners.sonos.com/node/292.

Softlayer Security Software Access Protection Logs

After ordering security software (McAFee Anti-virus), how to get anti-virus log and Access Protection Logs using API?
This information may help you:
https://forums.softlayer.com/forum/softlayer-developer-network/implementations/83143-python-api-retrieve-the-view-access-protection-logs
https://forums.softlayer.com/forum/softlayer-developer-network/implementations/83114-get-mcafee-epolicy-orchestrator-version45-event
Currently the information that you want to display is available only using SOAP request:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v3="http://api.service.softlayer.com/soap/v3/">
<soapenv:Header>
<authenticate xsi:type="v3:authenticate">
<username xsi:type="xsd:string">?</username>
<apiKey xsi:type="xsd:string">?</apiKey>
</authenticate>
<SoftLayer_Software_Component_AntivirusSpywareInitParameters xsi:type="v3:SoftLayer_Software_Component_AntivirusSpywareInitParameters">
<id xsi:type="xsd:int">9510000</id>
</SoftLayer_Software_Component_AntivirusSpywareInitParameters>
<SoftLayer_ObjectMask xsi:type="v3:SoftLayer_ObjectMask">
<mask xsi:type="xsd:string">?</mask>
</SoftLayer_ObjectMask>
<SoftLayer_Software_Component_AntivirusSpywareObjectFilter xsi:type="v3:SoftLayer_Software_Component_AntivirusSpywareObjectFilter"/>
<SoftLayer_Software_Component_AntivirusSpywareObjectMask xsi:type="v3:SoftLayer_Software_Component_AntivirusSpywareObjectMask">
<mask>
<latestAntivirusEvents>
<virusActionTaken/>
</latestAntivirusEvents>
</mask>
</SoftLayer_Software_Component_AntivirusSpywareObjectMask>
</soapenv:Header>
<soapenv:Body>
<v3:getObject soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</soapenv:Body>
</soapenv:Envelope>
There is an issue related to this problem.

WCF binding configuration for SalesForce Api

For an application i'm developing i need to make a call on the SalesForce api. With SvcUtil i generated a proxy and integrated this in my solution. After i made a call via code, i get the following request and exception response. I use a normal basicHttpBinding.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"></Action>
<VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink"></VsDebuggerCausalityData>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<login xmlns="urn:partner.soap.sforce.com">
<username>XXX</username>
<password>XXX</password>
</login>
</s:Body>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"></s:Header>
<soapenv:Body>
<soapenv:Fault>
<faultcode xmlns="">soapenv:Client</faultcode>
<faultstring xmlns="">No operation available for request {urn:partner.soap.sforce.com}login</faultstring>
</soapenv:Fault>
</soapenv:Body>
However, if call the service with SoapUI, i don't get any errors. After googling i tried to make some changes in the binding and created a custom binding for forcing the soap version to 1.2, but didn't find a good solution. What should i change in the binding configuration?
This is the SoapUI call:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
<soapenv:Body>
<urn:login>
<urn:username>XXXX</urn:username>
<urn:password>XXXX</urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
After some research i found out that creating a proxy using "Add service reference" creates a proxy that works. So my problem is solved. Still have to check what the difference is between the generated proxies.

How to solve the "cannot find soap action mapping for" soap api?

The request for soap api is given below
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WashOut"
<soapenv:Header/>
<soapenv:Body>
<urn:Activate_VAS_Request soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<OPER_NAME xsi:type="xsd:string">?</OPER_NAME>
<OPER_PASSWORD xsi:type="xsd:string">?</OPER_PASSWORD>
<MSISDN xsi:type="xsd:string">?</MSISDN>
<VAS_ID xsi:type="xsd:int">?</VAS_ID>
<PARAM_VAL xsi:type="xsd:string">?</PARAM_VAL>
</urn:Activate_VAS_Request>
</soapenv:Body>
</soapenv:Envelope>
and the response of the request is given below.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<soap:Fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<faultcode xsi:type="xsd:QName">Server</faultcode>
<faultstring xsi:type="xsd:string">Cannot find SOAP action mapping for</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
which thing causing the error.
This error means WashOut is unable to find the requested action (in your particular case it fails to even parse it – it's empty string).
Also the wash_out version you use is critically old. Current one is 0.9.0. Please upgrade.
I've seen that some Soap clients send the request in a way wash_out can't infer the soapAction value, as a consequence it can't link the request to an action in the wash_out controller.
For having a working reference, I think you should try a soap client such as soapUI or Savon, I've seen they send the request in a way wash_out can infer which is the soapAction in the request.

WSO2IS: Verifing user is already logged using ssoTokenId and IdentitySAMLSSOServiceSoap webservice

I have followed the steps in this tutorial to retrieve a ssoTokenID in my HTTP response header from the WSO2 Identity Server 4.1.0. I am running this locally.
I also have the the IdentitySAMLSSOService available at:
https://localhost:9443/services/IdentitySAMLSSOService?wsdl
This service provides 3 operations:
authenticate
doSingleLogout
validateRequest
Using the authenticate operation, I want to verify that the user is indeed logged in. I expect to use the ssoTokenId that I have retrieved earlier. Also, I assume that the JSESSIONID is not relevant at this point.
ssoTokenId=1E5F811E2FAC8AFBEE31621E889DE3FD
I have used soapUI to start a SOAP request to the authenticate service. I have added basic authentication username/password.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://dto.saml.sso.identity.carbon.wso2.org/xsd">
<soap:Header/>
<soap:Body>
<xsd:authenticate>
<!--Optional:-->
<xsd:authReqDTO>
<!--Optional:-->
<xsd1:assertionConsumerURL>http://localhost:8080/saml2.demo/consumer</xsd1:assertionConsumerURL>
<!--Optional:-->
<xsd1:assertionString></xsd1:assertionString>
<!--Optional:-->
<xsd1:certAlias></xsd1:certAlias>
<!--Optional:-->
<xsd1:claim></xsd1:claim>
<!--Optional:-->
<xsd1:doSignAssertions>false</xsd1:doSignAssertions>
<!--Optional:-->
<xsd1:doSingleLogout>false</xsd1:doSingleLogout>
<!--Optional:-->
<xsd1:id></xsd1:id>
<!--Optional:-->
<xsd1:issuer>saml2.demo</xsd1:issuer>
<!--Optional:-->
<xsd1:loginPageURL></xsd1:loginPageURL>
<!--Optional:-->
<xsd1:logoutURL></xsd1:logoutURL>
<!--Optional:-->
<xsd1:nameIDFormat></xsd1:nameIDFormat>
<!--Optional:-->
<xsd1:password></xsd1:password>
<!--Zero or more repetitions:-->
<xsd1:requestedClaims></xsd1:requestedClaims>
<!--Optional:-->
<xsd1:rpSessionId>1E5F811E2FAC8AFBEE31621E889DE3FD</xsd1:rpSessionId>
<!--Optional:-->
<xsd1:stratosDeployment>false</xsd1:stratosDeployment>
<!--Optional:-->
<xsd1:subject></xsd1:subject>
<!--Optional:-->
<xsd1:useFullyQualifiedUsernameAsSubject>false</xsd1:useFullyQualifiedUsernameAsSubject>
<!--Optional:-->
<xsd1:username></xsd1:username>
</xsd:authReqDTO>
<!--Optional:-->
<xsd:sessionId></xsd:sessionId>
</xsd:authenticate>
</soap:Body>
</soap:Envelope>
I received the following response:
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:authenticateResponse xmlns:ns="http://org.apache.axis2/xsd">
<ns:return xsi:type="ax2301:SAMLSSORespDTO" xmlns:ax2299="http://base.identity.carbon.wso2.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax2301="http://dto.saml.sso.identity.carbon.wso2.org/xsd">
<ax2301:assertionConsumerURL xsi:nil="true"/>
<ax2301:errorMsg>login.fail.message</ax2301:errorMsg>
<ax2301:loginPageURL xsi:nil="true"/>
<ax2301:respString><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response ID="dgjkpdhojndphkhklhlpcdjnbakojekiajbflpjp" IssueInstant="2013-07-11T08:46:32.008Z" Version="2.0" xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">https://localhost:9443/samlsso</saml2:Issuer><saml2p:Status><saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"/><saml2p:StatusMessage>login.fail.message</saml2p:StatusMessage></saml2p:Status></saml2p:Response>]]></ax2301:respString>
<ax2301:sessionEstablished>false</ax2301:sessionEstablished>
<ax2301:subject xsi:nil="true"/>
</ns:return>
</ns:authenticateResponse>
</soapenv:Body>
</soapenv:Envelope>
I have tried to add the value of ssoTokenId in different places:
I have tried adding the value of ssoTokenID to <xsd1:rpSessionId>
I have also tried to add it to <xsd:sessionId>
Also tried adding it to the header of the SOAP request.
Unfortunately, in all cases, there is a login.fail.message. What is the proper way to check if a user is already authenticated?