By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,493 Members | 3,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,493 IT Pros & Developers. It's quick & easy.

Not Authorized connecting Webservice in a trusted Domain

P: n/a
Hi
I try to call a Webservice via java, the webservice is loacated on a IIS-server(Dot-net).
It is a trusted Domain so I do not have to Connect with a Username and Password.
It seems to be a problem to get Information from the Service. At all I do not get Access.
Anybody have same problem or experiance with this.
I use following Code to access the Webservice. If anybody have other suggestions I am willing to try that
My Code.
import org.apache.soap.*;
import org.apache.soap.messaging.*;
import org.apache.soap.transport.http.*;
import javax.activation.*;
import org.xml.sax.*;
import java.io.*;
import java.util.Iterator;
public class JavaAgent {

Public void NotesMain() {
try {

String retval = "";

String url ="http://xxxxxxxxx.asmx";
System.out.println("url"+url);
String TargetNamespace ="http://tempuri.org/";

String SOAPAction ="http://tempuri.org/GetFunctione1";
if (url == null) {
throw new org.apache.soap.SOAPException(Constants.FAULT_CODE _CLIENT,
"A URL must be specified via " +
"SoapBuildersExSoapProxy.setEndPoint(URL).");
}

// Instantiate the message and the envelope.
// The message sends the envelope and gets
// the response.
Message message = new Message();
Envelope env = new Envelope();
DataHandler soapMsg = null;

// Get this from the soapAction attribute on the
// soap:operation element that is found within the SOAP
// binding information in the WSDL.
MessageBody theBody = new MessageBody();

theBody.orgId ="C42F504C40BB0A1EC1256F3F0032A80B";
theBody.dokType="6";

// Replace the default body with our own.
env.setBody( theBody );
message.send(new java.net.URL(url) , SOAPAction, env );
try{
// Because the Body.unmarshall handler is static,
// you cannot replace the basic machinery easily.
// Instead, you must obtain and parse the
// message on your own.
soapMsg = message.receive();

System.out.println( "***Result***: " + soapMsg.getContent().toString());
} catch ( Exception e ) {
System.out.println( "***Exception***: " + e.toString() );
}
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
JavaAgent ja = new JavaAgent();
ja.NotesMain();
}
}
---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Can you post the error you are receiving?

I suspect that this is a security setting issue on either the IIS side or
within the web service itself. If IIS, it sounds like you are expecting
the service site or vroot to allow anonymous access. Have you checked the
settings to assure this?

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
From: SqlJunkies User <User@-NOSPAM-SqlJunkies.com>
Organization: http://www.wimdows.net/newsgroups/
X-Newsreader: Wimdows.net NntpNews
Subject: Not Authorized connecting Webservice in a trusted Domain
Message-ID: <#u*************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Date: Thu, 02 Dec 2004 22:18:44 -0800
NNTP-Posting-Host: daisycutter 64.85.22.116
Lines: 1
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl!cpmsftngxa0
6.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gb l
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7787
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi
I try to call a Webservice via java, the webservice is loacated on a
IIS-server(Dot-net).
It is a trusted Domain so I do not have to Connect with a Username and
Password.
It seems to be a problem to get Information from the Service. At all I do
not get Access.
Anybody have same problem or experiance with this.
I use following Code to access the Webservice. If anybody have other
suggestions I am willing to try that
My Code.
import org.apache.soap.*;
import org.apache.soap.messaging.*;
import org.apache.soap.transport.http.*;
import javax.activation.*;
import org.xml.sax.*;
import java.io.*;
import java.util.Iterator;
public class JavaAgent {

Public void NotesMain() {
try {

String retval = "";

String url ="http://xxxxxxxxx.asmx";
System.out.println("url"+url);
String TargetNamespace ="http://tempuri.org/";

String SOAPAction ="http://tempuri.org/GetFunctione1";
if (url == null) {
throw new org.apache.soap.SOAPException(Constants.FAULT_CODE _CLIENT,
"A URL must be specified via " +
"SoapBuildersExSoapProxy.setEndPoint(URL).");
}

// Instantiate the message and the envelope.
// The message sends the envelope and gets
// the response.
Message message = new Message();
Envelope env = new Envelope();
DataHandler soapMsg = null;

// Get this from the soapAction attribute on the
// soap:operation element that is found within the SOAP
// binding information in the WSDL.
MessageBody theBody = new MessageBody();

theBody.orgId ="C42F504C40BB0A1EC1256F3F0032A80B";
theBody.dokType="6";

// Replace the default body with our own.
env.setBody( theBody );
message.send(new java.net.URL(url) , SOAPAction, env );
try{
// Because the Body.unmarshall handler is static,
// you cannot replace the basic machinery easily.
// Instead, you must obtain and parse the
// message on your own.
soapMsg = message.receive();

System.out.println( "***Result***: " + soapMsg.getContent().toString());
} catch ( Exception e ) {
System.out.println( "***Exception***: " + e.toString() );
}
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
JavaAgent ja = new JavaAgent();
ja.NotesMain();
}
}
---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.