Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9073455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:25:16+00:00 2026-06-16T18:25:16+00:00

I made a client to consume a web service, in Visual Studio 2010, using

  • 0

I made a client to consume a web service, in Visual Studio 2010, using WSDL to auto create the proxy classes. In development environment, that is ok, is working fine, because it don’t need to authenticate in this environment.

The problem i have is that the service, in test and production (the true working) environment, it have authentication. The WSDL don’t describe it. Both of them use the same WSDL of development environment.

If i try to view the WSDL, using browser, in test environment, putting the “?WSDL” after the endpoint address, it don’t returns the WSDL, like the development environment. It returns an authentication form, a normal html, and after inform user and password it returns the WSDL (same as development environment).

I made the app.config binding configs like this:

<wsHttpBinding>
          <binding name="WebServiceSoapAuth" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="true" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"  maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Mtom" textEncoding="utf-8"  useDefaultWebProxy="true">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
            <security mode="None">
              <transport clientCredentialType="Basic" proxyCredentialType="None" realm=""/>
              <message clientCredentialType="UserName" algorithmSuite="Default"/>
            </security>
          </binding>  
        </wsHttpBinding>

If i use the basicHttpBinding, that was created automatically by VS 2010 (works in dev environment), my service consumer returns “The security token could not be authenticated or authorized”, as expected.

Changing to wsHttpBinding (code above), it returns “The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: ” followed by the form authentication html code.

I can’t figure what binding configuration i have to use.

I tested the service consumption using SoapUI, and works in both environments, and to it works using authentication, i just had to inform user, password and needed to change the “WSS-Password Type” request config to “PasswordText” (informing just user and password i have the “The security token could not be authenticated or authorized” return).

I’m sorry about my bad english, i’m not fluent, and if i made some mistake in question category or formatting it.

EDIT: I CAN’T VISUALIZE the wsdl file in environment with authentication. When i put address followed by ?WSDL, it gives me a form to authenticate (A form from Ensemble InterSystems software), not the wsdl.

I tested the service consumption using SoapUI, and works in both environments, and to it works using authentication, i just had to inform user, password and needed to change the “WSS-Password Type” request config to “PasswordText” (informing just user and password i have the “The security token could not be authenticated or authorized” return).

Why it does not work using auto generated classes, just informing the user and pass? Someone have idea?
What binding configuration is equivalent to SoapUI configuration’s “WSS-Password Type” equals “PasswordText”? (i guess this is the key of why it doesn’t work if i just inform user and password)

EDIT 2: The body of the soap message is ok. I’m having trouble making the header. It might be something like:

<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-5">
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">E1XqZ2v8IDaTBzfF3j/TOA==</wsse:Nonce>
<wsu:Created>2012-12-21T12:24:23.380Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>

As i told, i don’t have access to the server, it is at my customer. I just know that it is made in java.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:25:17+00:00Added an answer on June 16, 2026 at 6:25 pm

    I had to make manually a http webrequest, and had to create the xml manually and passed it to to request. The postData variable comes from the xml manually created.

        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
        Dim req As HttpWebRequest = DirectCast(WebRequest.Create("http://site.customer/ens/qa/customer.bs.ws.service.cls"), HttpWebRequest)
        req.Method() = "POST"
        req.UserAgent = "Apache-HttpClient/4.1.1 (java 1.5)"
        req.ContentType = "text/xml;charset=UTF-8"
        req.ContentLength = byteArray.Length
        req.KeepAlive = True
        req.Host = "site.customer"
        req.AutomaticDecompression = 3
        req.Headers.Add("SOAPAction", "http://www.tempuri.org/customer.bs.ws.service.function")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using AmazonSimpleEmailServiceClient.sendEmail() ; as per java docs All service calls made using this client
I have made a REST Web service, that works with Visual Studios WCF Test
I have a client jar made-up using java 1.6 and used enum and other
I'm developing a web application with jax-rs, i made a rest client with jquery.
I've been developing a WCF web service using .NET 3.5 with IIS7 and it
Hi I made an echo client - server code using datagram. The code is
I have made a basic client and server in C using BSD sockets. I
We want any calls to our .asmx web service to be made by the
I created a simple WCF web service(following this tutorial: http://blogs.msdn.com/b/ericwhite/archive/2010/05/11/getting-started-building-a-wcf-web-service.aspx ), because I don't
I'm using RESTEasy 2.2.1.GA as my JAX-RS implementation to create a client to connect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.