Example of SOAP request authenticated with WS-UsernameToken - web-services

I'm trying to authenticate a SOAP request using WS-UsernameToken spec, but the target device is always denying access. My non-working request looks like this. (The password I'm trying to hash is system.)
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Header>
<Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<UsernameToken>
<Username>root</Username>
<Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">EVpXS/7yc/vDo+ZyIg+cc0fWdMA=</Password>
<Nonce>tKUH8ab3Rokm4t6IAlgcdg9yaEw=</Nonce>
<Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2010-08-10T10:52:42Z</Created>
</UsernameToken>
</Security>
</Header>
<Body>
<SomeRequest xmlns="http://example.ns.com/foo/bar" />
</Body>
</Envelope>
What I'm looking for is a similar request example, but with authentication token that actually works. For example if you have gSOAP application that uses these token, and can generate a request and post the result here, I'd be very grateful.

The core thing is to define prefixes for namespaces and use them to fortify each and every tag - you are mixing 3 namespaces and that just doesn't fly by trying to hack defaults. It's also good to use exactly the prefixes used in the standard doc - just in case that the other side get a little sloppy.
Last but not least, it's much better to use default types for fields whenever you can - so for password you have to list the type, for the Nonce it's already Base64.
Make sure that you check that the generated token is correct before you send it via XML and don't forget that the content of wsse:Password is Base64( SHA-1 (nonce + created + password) ) and date-time in wsu:Created can easily mess you up. So once you fix prefixes and namespaces and verify that yout SHA-1 work fine without XML (just imagine you are validating the request and do the server side of SHA-1 calculation) you can also do a truial wihtout Created and even without Nonce. Oh and Nonce can have different encodings so if you really want to force another encoding you'll have to look further into wsu namespace.
<S11:Envelope xmlns:S11="..." xmlns:wsse="..." xmlns:wsu= "...">
<S11:Header>
...
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>NNK</wsse:Username>
<wsse:Password Type="...#PasswordDigest">weYI3nXd8LjMNVksCKFV8t3rgHh3Rw==</wsse:Password>
<wsse:Nonce>WScqanjCEAC4mQoBE07sAQ==</wsse:Nonce>
<wsu:Created>2003-07-16T01:24:32</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
...
</S11:Header>
...
</S11:Envelope>

The Hash Password Support and Token Assertion Parameters in Metro 1.2 explains very nicely what a UsernameToken with Digest Password looks like:
Digest Password Support
The WSS 1.1 Username Token
Profile allows digest passwords to
be sent in a wsse:UsernameToken of a
SOAP message. Two more optional
elements are included in the
wsse:UsernameToken in this case:
wsse:Nonce and wsse:Created. A
nonce is a random value that the
sender creates to include in each
UsernameToken that it sends. A
creation time is added to combine
nonces to a "freshness" time period.
The Password Digest in this case is
calculated as:
Password_Digest = Base64 ( SHA-1 ( nonce + created + password ) )
This is how a UsernameToken with
Digest Password looks like:
<wsse:UsernameToken wsu:Id="uuid_faf0159a-6b13-4139-a6da-cb7b4100c10c">
<wsse:Username>Alice</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">6S3P2EWNP3lQf+9VC3emNoT57oQ=</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">YF6j8V/CAqi+1nRsGLRbuZhi</wsse:Nonce>
<wsu:Created>2008-04-28T10:02:11Z</wsu:Created>
</wsse:UsernameToken>

Check this one (Password should be password):
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-6138db82-5a4c-4bf7-915f-af7a10d9ae96">
<wsse:Username>user</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">CBb7a2itQDgxVkqYnFtggUxtuqk=</wsse:Password>
<wsse:Nonce>5ABcqPZWb6ImI2E6tob8MQ==</wsse:Nonce>
<wsu:Created>2010-06-08T07:26:50Z</wsu:Created>
</wsse:UsernameToken>

May be this post (Secure Metro JAX-WS UsernameToken Web Service with Signature, Encryption and TLS (SSL)) provides more insight. As they mentioned "Remember, unless password text or digested password is sent on a secured channel or the token is encrypted, neither password digest nor cleartext password offers no real additional security. "

Related

How to get WSDL by request to Siebel Inbound WebService?

Usually Web-services return WSDL by request like this:
http://web_server_host.com/WS_virtual_folder/?wsdl
I've created Siebel Inbound WS.
URL of my WS looks like this:
http://web_server_host/eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute&UserName=SADMIN&Password=passwrd
There is a possibility to generate WSDL in the Siebel UI by clicking the button "Generate WSDL".
I tried to make my WS to return WSDL: I added one more parameter &wsdl to URL of my WS.
It doesn't work:
When I request URL by web-browser (only URL is sending, there is no soap-message) - I get error like this:
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Supplied input is not well formed or does not contain the expected data.(SBL-EAI-00137)</faultstring>
<detail>
<siebelf:siebdetail>
<siebelf:logfilename>EAIObjMgr_enu_0026_27262989.log</siebelf:logfilename>
<siebelf:errorstack>
<siebelf:error>
<siebelf:errorcode>SBL-EAI-00137</siebelf:errorcode>
<siebelf:errorsymbol>IDS_EAI_WS_BAD_XML_DOCUMENT</siebelf:errorsymbol>
<siebelf:errormsg>Supplied input is not well formed or does not contain the expected data.(SBL-EAI-00137)</siebelf:errormsg>
</siebelf:error>
<siebelf:error>
<siebelf:errorcode>SBL-EAI-00246</siebelf:errorcode>
<siebelf:errorsymbol>IDS_XMLCNV_ERR_EMPTYMSG</siebelf:errorsymbol>
<siebelf:errormsg>XML Hierarchy Converter error - empty input message, expecting an XML document in <Value> of input arguments(SBL-EAI-00246)</siebelf:errormsg>
</siebelf:error>
</siebelf:errorstack>
</siebelf:siebdetail>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This response (error) is the same for both URL (with or without parameter &wsdl)
When I request URL by SoapUI (soap-message is sending) - I get again same response for both URL (with or without parametr &wsdl)
Is there such possibility: to get WSLD from Siebel Inbound WS by requesting URL?
I haven't found any mentions about it in the bookshelf.
Thanks in advance.
Sergey
Siebel WSDLs cannot be generated from URLs like an Axis service. The onlyway is to login to the application and click on the Generate WSDL button in the Webservices screen.

Coldfusion - HTTPS error / X.509 ws-security

I'm very new to SOAP, and this is my first project. I am trying to connect to a HTTPS WSDL in order to pull some information on my webpage.
There is a certificate setup ready for both local server connect with the service provider server. There is a response when I try to connect the https webservice, so I believe there is no connection issue between both server :
Here is the SOAPUI sample given from the third party technical team :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap="http://soap.ipr.tfp.com/">
<soapenv:Header/>
<soapenv:Body>
<soap:create>
<arg0>
<attribute_1>abc</attribute_1>
<attribute_2></attribute_2>
<attribute_3>abc123</attribute_3>
<attribute_4>abc234</attribute_4>
<attribute_5></attribute_5>
</arg0>
</soap:create>
</soapenv:Body>
</soapenv:Envelope>
Below is my cfm code used to connect the Webservice :
<cfscript>
ws = CreateObject("webservice", [HTTPS URL]?wsdl);
//show web service methods for debugging purposes
writeDump(ws);
// construct arguments
args = {attribute_1="abc"
, attribute_2=""
, attribute_3="abc123"
, attribute_4="abc234"
, attribute_5=""
};
// call the method
result = ws.create(arg0=args);
writeDump(result)
</cfscript>
Issue :
I'm getting below error message when execute my cfm script :
Cannot perform web service invocation create.
The fault returned when invoking the web service operation is:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: These policy alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}AsymmetricBinding: Received Timestamp does not match the requirements
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token: The received token does not match the token inclusion requirement
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}InitiatorToken
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}RecipientToken
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IncludeTimestamp: Received Timestamp does not match the requirements
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}SignedParts: {http://schemas.xmlsoap.org/soap/envelope/}Body not SIGNED
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}EncryptedParts: {http://schemas.xmlsoap.org/soap/envelope/}Body not ENCRY...
Questions :
Is this error related to the SSL certificate setup in the ColdFusion keystore?
Anything wrong with my CFM script? Refer to the SOAPUI sample, the xml format is `[arg0] --> [attribute_1], [attribute_2] and so on. Can I pass the attributes this way?
result = ws.create(arg0=args);
The same service works from SoapUI tool. Am I missing anything here?
Thank you for your time. Your help is appreciated.
2016-05-30 - Update -
I tried to use the CFHTTP tag to submit the XML, but it seemed to return a differenct error:
<cfhttp
url = "[HTTPS URL]?wsdl"
method ="post"
result ="httpResponse"
charset ="utf-8">
<cfhttpparam
type="header"
name="accept-encoding"
value="no-compression"
/>
<cfhttpparam
type="xml"
value="#trim( soapBody )#"
/>
</cfhttp>
Error:
Here is the error message in the file content :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>These policy alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
AsymmetricBinding: Received Timestamp does not match the requirements
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
X509Token: The received token does not match the token inclusion requirement
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
X509Token
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
InitiatorToken
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
RecipientToken
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
IncludeTimestamp: Received Timestamp does not match the requirements
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
SignedParts: {http://schemas.xmlsoap.org/soap/envelope/}
Body not SIGNED
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}
EncryptedParts:
{http://schemas.xmlsoap.org/soap/envelope/}
Body not ENCRYPTED
</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
The error message seems similar to cfobject tag. When I read closely in the error message, it seemed related with the X.509 ws-security encryption where the SOAP content needs to encrypted before send to the Web service request.
After did some research, the encryption flow seem work as below:
Save SOAP content into temp folder.
Used Java Class file to encrypt the SOAP content into X.509 ws-security format.
Sent new encrypted SOAP content to Webservice.
I have no idea how CF works with Java class files. Has anyone done the same encryption conversion before?
In your code to connect to web service, change
ws = CreateObject("webservice", [HTTPS URL]);
to
ws = CreateObject(
"webservice",
"[HTTPS URL]",
{wsversion="1"}
);
in case only Axis 1 works for you.
Also check at the other end, if your using ColdFusion to expose the web service make sure is set up for Axis 1.

Spring 4 REST web-services not working with security

I am using Spring 4, with Spring Security 4 to secure web-services. A normal web-service worked fine without security. My secured web-services also seemed to work great working locally and with unit testing.
We are using the SiteMinder example, which means we have authentication happenind from a remote authority. This delivers a token to the browser when we login. We pass the authentication token with a request header, and this is pulled from customerUserDetailsService. That class and methods pull the token from the header, authenticates the user against that remote authority, and we get a username. From that username, we make a DAO call to our database to get the User Details and their Roles, which in the Spring Security Context uses the roles to grant authority. This is all working fine, and we get an authenticated user and we have thier roles/grantedAuthorities.
So, as previously stated, we are now just securing web-services with spring-security.xml to secure the web-services based on the role of the user. Again, this all seemed to work fine with unit testing. We had a token for a user who did not have access to web-sites and we correctly got back a 403 error. When we used a token for a user who did have the right role, was able to execute the web-service.
Now I am trying to deploy this into a new environment, and I am not having much luck.
So, I have a spring-security.xml that looks like:
<http use-expressions="true" auto-config="false" entry-point-ref="http403EntryPoint">
<!-- Additional http configuration omitted -->
<intercept-url pattern="/records/authorizedRecords" access="hasRole('portalUser')" />
<intercept-url pattern="/records/myCode" access="hasRole('portalUser')" />
<intercept-url pattern="/users/email" access="hasRole('appAdmin')" />
<custom-filter position="PRE_AUTH_FILTER" ref="openAmFilter" />
</http>
<beans:bean id="openAmFilter" class="org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter">
<beans:property name="principalRequestHeader" value="openam_token"/>
<beans:property name="authenticationManager" ref="authenticationManager" />
</beans:bean>
<beans:bean id="preauthAuthProvider" class="org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider">
<beans:property name="preAuthenticatedUserDetailsService">
<beans:bean id="userDetailsServiceWrapper" class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
<beans:property name="userDetailsService" ref="customUserDetailsService"/>
</beans:bean>
</beans:property>
</beans:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="preauthAuthProvider" />
</authentication-manager>
<beans:bean id="customUserDetailsService" class="com.agmednet.server.security.CustomUserDetailsService"></beans:bean>
<beans:bean id="http403EntryPoint" class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint">
When we tried access to:
<intercept-url pattern="/users/email/*" access="hasRole('appAdmin')" />
this did not seem to match:
/rest/users/email/myemail#someemail.com
so I changed it to:
<intercept-url pattern="/rest/users/email/*" access="hasRole('appAdmin')" />
And I get this from the log.
DEBUG: org.springframework.security.web.util.matcher.AntPathRequestMatcher - Checking match of request : '/rest/trials/integratedtrials'; against '/rest/users/email/*'
DEBUG: org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Public object - authentication not attempted
DEBUG: org.springframework.security.web.FilterChainProxy - /rest/trials/integratedTrials reached end of additional filter chain; proceeding with original chain
DEBUG: org.springframework.security.web.access.ExceptionTranslationFilter - Chain processed normally
DEBUG: org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
At this point, I know we have an authenticated user, the username, and the roles are listed right there in the logs. We seem to find a matching URL in the spring-security.xml, the URL matches, the roles match, and now I feel we should be executing the logic behind the web-service, but I get an error message:
Apache Tomcat/8.0.30 - Error report
/services/rest/users/email/myemail#someemail.com
The requested resource is not available.
I am absolutely floored here .... unsecured web-services work great. I have to be missing something? Is it with the word "rest" in the URL? Web-services have always worked when they were unsecured. I added security and add unit tests to test this all out, and now I am unsure of what happened?
The problem is that I am an idiot!!!!
In the /WEB-INF/web.xml file I had this defined:
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
I suppose that is why when I call any RESTful web-services with:
/rest/users/email/myemail#someemail.com
it doesn't work.
But when I use:
/api/users/email/myemail#someemail.com
now it works.
Conclusion: I am an idiot!!!

How do I create a Mule ESB Service to HTTP POST using name/value pairs?

I need to create a mule service that will POST data to a web service that expects name/value pairs (not xml), then process the XML response from that service. I cannot find a good example on how to prep the payload for an http POST.
Can someone provide some insight or examples?
What I have so far is (I don't know if 'PathToTransformerClass' is needed):
<service name="myService">
<inbound>
<vm:inbound-endpoint path="myService.request" synchronous="true">
<custom-transformer class="PathToTransformerClass" />
</vm:inbound-endpoint>
</inbound>
<outbound>
<pass-through-router>
<http:outbound-endpoint address="URIofWebServiceToPostTo" method="POST" synchronous="true">
<response-transformers>
<custom-transformer class="PathToClassToProcessTheResponse" />
</response-transformers>
</http:outbound-endpoint>
</pass-through-router>
</outbound>
</service>
The following might be helpful: http://comments.gmane.org/gmane.comp.java.mule.user/29342
I can't find any examples either, but it looks like the built-in HTTP transformers are
http-response-to-object-transformer A
transformer that converts an HTTP
response to a Mule Message. The
payload may be a String, stream, or
byte array.
http-response-to-string-transformer
Converts an HTTP response payload
into a string. The headers of the
response will be preserved on the
message.
object-to-http-request-transformer
This transformer will create a valid
HTTP request using the current message
and any HTTP headers set on the
current message.
message-to-http-response-transformer
This transformer will create a valid
HTTP response using the current
message and any HTTP headers set on
the current message.
object-to-http-request-transformer might be your best bet; perhaps you can create a map of key-value pairs and then convert that into URL encoded form? Not sure but hopefully this gives you some things to Google.
Are you asking about how to take XML and create key value pairs to send out via HTTP? For that you can use an XLST transformer where in the XSL you set the method output to be text.
1) Let variables=<map><entry><string>idEvent_Type</string><string>1</string></entry></map>&options=user:admin
be the Map body to post as HTTP request.
2) URL encode it (eg. using http://meyerweb.com/eric/tools/dencoder/)
which produce :
variables%3D%3Cmap%3E%3Centry%3E%3Cstring%3EidEvent_Type%3C%2Fstring%3E%3Cstring%3E1%3C%2Fstring%3E%3C%2Fentry%3E%3C%2Fmap%3E%26options%3Duser%3Aadmin
3) then create a Mule set-payload transformer :
<set-payload value="variables%3D%3Cmap%3E%3Centry%3E%3Cstring%3EidEvent_Type%3C%2Fstring%3E%3Cstring%3E1%3C%2Fstring%3E%3C%2Fentry%3E%3C%2Fmap%3E%26options%3Duser%3Aadmin
" doc:name="Set playload"/>
4) then create a Mule HTTP endpoint :
<http:outbound-endpoint exchange-pattern="request-response" host="..." port="..." path="..." user="..." password="..." contentType="application/x-www-form-urlencoded" doc:name="POSTHTTPRequest"/>
and it works
Maybe U can give a try using Object-to-http-request-transformer as this transformer will create a valid HTTP request using the message currently received and any HTTP headers set on the current message.
Have never tried it, but that is the only transformer I can get in my mind after reading ur query...hope it works.. :D

Anyone using Bing Map Web Services with Delphi?

Has anyone gotten Bing Map Web Services (formerly Virtual Earth Web Services) working with Delphi?
Based on my experiences so far (both using Delphi and Visual Studio C#), I'm about ready to give up on it and go with the MapPoint Web Service until a future version of Bing Maps Web Services comes out. However, I thought I'd post a question here as a last resort...
I imported the Token Service and Geocode Services WSDL documents.
I was successfully able to get a token from the token service, but have been unable to get the Geocode service to work at all. It always returns the following error message:
The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
I noticed Delphi wasn't specifying a value for the SOAPAction header, so I tried specifying "http://staging.dev.virtualearth.net/webservices/v1/geocode/contracts/IGeocodeService/Geocode" and got the following error message instead:
The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
Below is my Delphi code and the raw XML being sent, then the raw XML being sent by a similar call from Microsoft's sample C# code. There are several differences in the XML, but I'm not sure what difference(s) is the key.
var
Service: IGeocodeService;
Request: Geocode;
Response: GeocodeResponse3;
ResponseIndex: Integer;
Token: WideString;
Filters: ArrayOfFilterBase;
begin
Token := GetToken;
Service := GetIGeocodeService;
Request := Geocode.Create;
try
Request.request := GeocodeRequest.Create;
Request.request.Credentials := GeocodeService.Credentials.Create; // Freed by GeocodeRequest class
Request.request.Credentials.Token := Token;
Request.request.Query := AddressEdit.Text;
Request.request.Options := GeocodeOptions.Create;
SetLength( Filters, 1 );
Filters[ 0 ] := ConfidenceFilter.Create;
ConfidenceFilter( Filters[ 0 ] ).MinimumConfidence := GeocodeService.High_;
Request.request.Options.Filters := Filters;
Response := Service.Geocode( Request );
try
for ResponseIndex := Low( Response.GeocodeResult.Results ) to High( Response.GeocodeResult.Results ) do
begin
OutputMemo.Lines.Add( Response.GeocodeResult.Results[ ResponseIndex ].DisplayName );
end;
finally
Response.Free;
end;
finally
Request.Free;
end;
end;
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS2="http://dev.virtualearth.net/webservices/v1/geocode/contracts" xmlns:NS3="http://dev.virtualearth.net/webservices/v1/geocode" xmlns:NS4="http://dev.virtualearth.net/webservices/v1/common">
<NS1:Geocode xmlns:NS1="http://dev.virtualearth.net/webservices/v1/geocode/contracts">
<parameters href="#1"/>
</NS1:Geocode>
<NS2:Geocode id="1" xsi:type="NS2:Geocode">
<request href="#2"/>
</NS2:Geocode>
<NS3:request id="2" xsi:type="NS3:GeocodeRequest">
<Credentials href="#3"/>
<Options href="#4"/>
<Query xsi:type="xsd:string">Some Address</Query>
</NS3:request>
<NS4:Credentials id="3" xsi:type="NS4:Credentials">
<Token xsi:type="xsd:string">cbYkKgNlrsGnZbn3HRP7Xp5LJMv3RR_5qECwgB792COfY3EPmviaDpZ4mmD3fDP1Osc6fWUkTptog7bfgM73bA2</Token>
</NS4:Credentials>
<NS3:Options id="4" xsi:type="NS3:GeocodeOptions">
<Filters xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="NS3:FilterBase[1]">
<item href="#5"/>
</Filters>
</NS3:Options>
<NS3:ConfidenceFilter id="5" xsi:type="NS3:ConfidenceFilter">
<MinimumConfidence xsi:type="NS4:Confidence">High</MinimumConfidence>
</NS3:ConfidenceFilter>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<Geocode xmlns="http://dev.virtualearth.net/webservices/v1/geocode/contracts">
<request xmlns:a="http://dev.virtualearth.net/webservices/v1/geocode" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Credentials xmlns="http://dev.virtualearth.net/webservices/v1/common">
<ApplicationId i:nil="true"/>
<Token>pezCDpJoxdCG63NQdJUGkTrYYalnuSQDwuIC9FvheFAd9MIPO75qX9n7il0dx3eTEHlN2877PzN1_6YbQDL5tg2</Token>
</Credentials>
<Culture i:nil="true" xmlns="http://dev.virtualearth.net/webservices/v1/common"/>
<ExecutionOptions i:nil="true" xmlns="http://dev.virtualearth.net/webservices/v1/common"/>
<UserProfile i:nil="true" xmlns="http://dev.virtualearth.net/webservices/v1/common"/>
<a:Address i:nil="true" xmlns:b="http://dev.virtualearth.net/webservices/v1/common"/>
<a:Options>
<a:Count i:nil="true"/>
<a:Filters>
<a:FilterBase i:type="a:ConfidenceFilter">
<a:MinimumConfidence>High</a:MinimumConfidence>
</a:FilterBase>
</a:Filters>
</a:Options>
<a:Query>1 Microsoft Way, Redmond, WA</a:Query>
</request>
</Geocode>
</s:Body>
</s:Envelope>
My best guess is that Delphi seems to be producing too many Geocode elements - there doesn't appear to be any thing that corresponds to NS2:Geocode in the C# produced XML. If you can intercept the XML and change it so that it looks like this, who knows - it might work:
...
<NS1:Geocode xmlns:NS1="http://dev.virtualearth.net/webservices/v1/geocode/contracts">
<parameters href="#2"/>
</NS1:Geocode>
<NS3:request id="2" xsi:type="NS3:GeocodeRequest">
...
The other problem could be that the Bing service doesn't support the way Delphi organizes the SOAP request.
It that doesn't work, perhaps you can find another SOAP library you can use with Delphi - perhaps resorting to wrapping a library with a C or COM interface.
I have exatctly the same problem. I run Delphi 2006, used WSDLImp.exe in command mode; needed version 11.0 of 2006 to get the import work. What do you use? We have the intention to try RemObjects, version 6. Any guess if that would work better?
Cheers,
Lars