---
title: "Problem med att konsumera web service"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/181496-problem-med-att-konsumera-web-service"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "weedogt"
published: "2009-12-02T18:18:57.000Z"
updated: "2009-12-02T18:18:57.000Z"
replies: 0
views: 373
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/181496-problem-med-att-konsumera-web-service"
---

# Problem med att konsumera web service

## #1 — weedogt, 2009-12-02T18:18Z

Hej,

Jag använder Visual Web Developer 2008 Express Edition för att prova hur man konsumerar en web service men jag får det inte att funka.

Jag har gjort detta:
\- Jag använder "Add web reference..." och adderar denna service:
<http://services.msdn.microsoft.com/ContentServices/ContentService.asmx>
\- Jag använder default namnet "com.microsoft.msdn.services" och klickar "Add reference..."
\- Servicen adderas till Solution explorer
\- Web.config ser ut som nedan
\- Jag gör en .aspx page enligt nedan. Texten com.microsoft... och så vidare kommer upp när jag skriver (aktuell namespace verkar bli igenkänd).
\- Sidan verkar bygga ok.
\- När jag kör sidan (localhost) får jag ett fel:
BC30002: Type 'com.microsoft.msdn.services.getContentRequest' is not defined.

Var kan problemet vara? Alla tips mottages tacksamt!

> \<?xml version="1.0"?\>
> \<configuration\>
> 	\<appSettings\>
> 		\<add key="com.microsoft.msdn.services.ContentService" value="http://services.msdn.microsoft.com/ContentServices/ContentService.asmx"/\>
> 	\</appSettings\>
> 	\<connectionStrings/\>
> 	\<system.web\>
> 		\<compilation debug="true"\>
> 		\</compilation\>
> 	\</system.web\>
> \</configuration\>

> \<%@ Page Language="VB" debug="true"%\>
> \<%@ Import Namespace="System" %\>
> \<%@ Import Namespace="System.Web.Services.Protocols" %\>
> \<%@ Import Namespace="System.Xml" %\>
> \<%@ Import Namespace="System.Xml.Serialization" %\>
>  
> \<script runat="server"\>
>  
>     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
>         'Create an instance of the Proxy class
>         Dim proxy As com.microsoft.msdn.services.getContentRequest
>         proxy = New com.microsoft.msdn.services.getContentRequest
>         
>     End Sub
> \</script\>
>  
> \<html xmlns="http://www.w3.org/1999/xhtml"\>
> \<head runat="server"\>
>     \<title\>Untitled Page\</title\>
> \</head\>
> \<body\>
>     \<form id="form1" runat="server"\>
>     \<div\>
>     
>     \</div\>
>     \</form\>
> \</body\>
> \</html\>

Permalänk: https://www.webforum.nu/p/181496

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/181496-problem-med-att-konsumera-web-service
